Skip to content

Commit 64accca

Browse files
test(javascript): cover comments inside a new's callee and before a directive
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
1 parent 72d9611 commit 64accca

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎test/unitCases/javascript/printer.unittest.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12551,6 +12551,13 @@ const {
1255112551
const SOURCES = [
1255212552
// Names beyond ASCII, one a surrogate pair, spaced from the words beside them.
1255312553
"var ä = 1, 𐊧 = 2; typeof ä, ä in 𐊧, void 𐊧, new ä(), ä instanceof ä;",
12554+
// Comments inside the `(` a `new` reads its callee past, nested, not before
12555+
// the function opening it, and before a directive past an empty statement.
12556+
"new(/**/function(){function s(){}}())",
12557+
"new(/*a*/(/*b*/function(){}()))",
12558+
"new(function(){}, /*c*/ a);",
12559+
"function f(){ ; /*a*/ 'x' }",
12560+
"function f(){ ; /**/ 'x' }",
1255412561
"/*!a*/\nfunction f(){return /*x*/ 1e999+(a,b)}",
1255512562
'var a = {b:1, "c d": [1,,2,], [e]: f, get g(){return 1}, h(){}, ...i, 1e3: 2, 0x10: 3};',
1255612563
"class A extends B { #x = 1; static m(){ return #x in this } static { a } get [k](){} 'q'(){} static async *g(){} }",

0 commit comments

Comments
 (0)