diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-07-13 23:06:35 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:42 -0400 |
commit | 92ca89f5f791656b593596e0ce992cf1e1e42b41 (patch) | |
tree | 501c4cafea17203b64f5d14743e5ec03e0237452 /js | |
parent | 22dba02b7bcab4d6dfe6b326ecc0a746e5a87191 (diff) | |
download | UXP-92ca89f5f791656b593596e0ce992cf1e1e42b41.tar UXP-92ca89f5f791656b593596e0ce992cf1e1e42b41.tar.gz UXP-92ca89f5f791656b593596e0ce992cf1e1e42b41.tar.lz UXP-92ca89f5f791656b593596e0ce992cf1e1e42b41.tar.xz UXP-92ca89f5f791656b593596e0ce992cf1e1e42b41.zip |
1357483 - Stop changing the end position of parenthesized expression ParseNodes.
Diffstat (limited to 'js')
-rw-r--r-- | js/src/frontend/Parser.cpp | 1 | ||||
-rw-r--r-- | js/src/tests/ecma_6/Class/parenExprToString.js | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 1be57f8f5..ec4a975e6 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -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); } diff --git a/js/src/tests/ecma_6/Class/parenExprToString.js b/js/src/tests/ecma_6/Class/parenExprToString.js new file mode 100644 index 000000000..a93972ce9 --- /dev/null +++ b/js/src/tests/ecma_6/Class/parenExprToString.js @@ -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"); |