1357483 - Stop changing the end position of parenthesized expression ParseNodes.

This commit is contained in:
Fedor 2019-09-05 20:06:47 +03:00
parent 3464bbc4ce
commit 8d007f4de3
2 changed files with 8 additions and 1 deletions

View File

@ -9820,7 +9820,6 @@ Parser<ParseHandler>::primaryExpr(YieldHandling yieldHandling, TripledotHandling
if (!expr)
return null();
MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_IN_PAREN);
handler.setEndPosition(expr, pos().end);
return handler.parenthesize(expr);
}

View File

@ -0,0 +1,8 @@
// Test that parenthesized class expressions don't get their toString offsets
// messed up.
assertEq((class {}).toString(), "class {}");
assertEq(((class {})).toString(), "class {}");
if (typeof reportCompare === "function")
reportCompare(0, 0, "OK");