mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 14:17:30 +09:00
1357483 - Stop changing the end position of parenthesized expression ParseNodes.
This commit is contained in:
parent
ab85510c20
commit
bbb2447fb0
2 changed files with 8 additions and 1 deletions
|
|
@ -9820,7 +9820,6 @@ Parser<ParseHandler>::primaryExpr(YieldHandling yieldHandling, TripledotHandling
|
||||||
if (!expr)
|
if (!expr)
|
||||||
return null();
|
return null();
|
||||||
MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_IN_PAREN);
|
MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_IN_PAREN);
|
||||||
handler.setEndPosition(expr, pos().end);
|
|
||||||
return handler.parenthesize(expr);
|
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…
Add table
Add a link
Reference in a new issue