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

This commit is contained in:
Gaming4JC 2019-07-13 23:06:35 -04:00 committed by Roy Tam
commit bbb2447fb0
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");