1357483 - Stop changing the end position of parenthesized expression ParseNodes.
This commit is contained in:
parent
3464bbc4ce
commit
8d007f4de3
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
8
js/src/tests/ecma_6/Class/parenExprToString.js
Normal file
8
js/src/tests/ecma_6/Class/parenExprToString.js
Normal 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");
|
Loading…
Reference in New Issue
Block a user