<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[198144] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/198144">198144</a></dd>
<dt>Author</dt> <dd>sbarati@apple.com</dd>
<dt>Date</dt> <dd>2016-03-14 11:38:28 -0700 (Mon, 14 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>assignments in for-in/for-of header not allowed
https://bugs.webkit.org/show_bug.cgi?id=155384
Reviewed by Darin Adler.
Source/JavaScriptCore:
This patch prevents assignments to the loop variable
in for in/of loops in all but one situation. The following
syntax is still allowed even though the spec prevents it:
```
for (var i = X in blah) ;
```
If the loop contains let/const, destructuring, or is a for-of
loop, we always throw a syntax error if there is an assignment.
We can do this with full backwards compatibility.
We only allow the above type of for-in loops because Oliver told
me that when he tried to make such programs illegal he ran
into real websites breaking.
This patch also removed the !::CreatesAST compile-time branch when checking
assignments to new.target. This was a dangerous thing for me
to introduce into our parser. There are times where ::CreatesAST
is true but we also want to check for syntax errors. For example,
when parsing the top-level AST of a program. Though this check
was technically correct, it's dangerous to have. It was correct
because we would always be reparsing the new.target assignment
because new.target is only allowed inside a function. That made it
so that (!::CreatesAST <=> we care about new.target assignment syntax errors).
But, (!::CreatesAST <=> we care about syntax error X) is not true in general.
I think it's safer to remove such code.
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createNewTargetExpr):
(JSC::ASTBuilder::isNewTarget):
(JSC::ASTBuilder::createResolve):
* parser/Nodes.h:
(JSC::ExpressionNode::isBoolean):
(JSC::ExpressionNode::isSpreadExpression):
(JSC::ExpressionNode::isSuperNode):
(JSC::ExpressionNode::isNewTarget):
(JSC::ExpressionNode::isBytecodeIntrinsicNode):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseForStatement):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseUnaryExpression):
LayoutTests:
* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsparsersyntaxcheckexpectedtxt">trunk/LayoutTests/js/parser-syntax-check-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsparsersyntaxcheckjs">trunk/LayoutTests/js/script-tests/parser-syntax-check.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserASTBuilderh">trunk/Source/JavaScriptCore/parser/ASTBuilder.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodesh">trunk/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParsercpp">trunk/Source/JavaScriptCore/parser/Parser.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/LayoutTests/ChangeLog        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-03-14 Saam barati <sbarati@apple.com>
+
+ assignments in for-in/for-of header not allowed
+ https://bugs.webkit.org/show_bug.cgi?id=155384
+
+ Reviewed by Darin Adler.
+
+ * js/parser-syntax-check-expected.txt:
+ * js/script-tests/parser-syntax-check.js:
+
</ins><span class="cx"> 2016-03-14 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Negative outline offset could break curved outline-style: auto
</span></span></pre></div>
<a id="trunkLayoutTestsjsparsersyntaxcheckexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/parser-syntax-check-expected.txt (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/parser-syntax-check-expected.txt        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/LayoutTests/js/parser-syntax-check-expected.txt        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -526,6 +526,36 @@
</span><span class="cx"> PASS Invalid: "function f() { for (var (a) in b) { } }"
</span><span class="cx"> PASS Valid: "for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}" with ReferenceError
</span><span class="cx"> PASS Valid: "function f() { for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {} }"
</span><ins>+PASS Invalid: "for (var {a} = 20 in b) { }"
+PASS Invalid: "function f() { for (var {a} = 20 in b) { } }"
+PASS Invalid: "for (var {a} = 20 of b) { }"
+PASS Invalid: "function f() { for (var {a} = 20 of b) { } }"
+PASS Invalid: "for (var {a} = 20 in b) { }"
+PASS Invalid: "function f() { for (var {a} = 20 in b) { } }"
+PASS Valid: "for (var i = 20 in b) { }" with ReferenceError
+PASS Valid: "function f() { for (var i = 20 in b) { } }"
+PASS Invalid: "for (var i = 20 of b) { }"
+PASS Invalid: "function f() { for (var i = 20 of b) { } }"
+PASS Invalid: "for (var {i} = 20 of b) { }"
+PASS Invalid: "function f() { for (var {i} = 20 of b) { } }"
+PASS Invalid: "for (var [i] = 20 of b) { }"
+PASS Invalid: "function f() { for (var [i] = 20 of b) { } }"
+PASS Invalid: "for (let [i] = 20 of b) { }"
+PASS Invalid: "function f() { for (let [i] = 20 of b) { } }"
+PASS Invalid: "for (const [i] = 20 of b) { }"
+PASS Invalid: "function f() { for (const [i] = 20 of b) { } }"
+PASS Invalid: "for (const i = 20 of b) { }"
+PASS Invalid: "function f() { for (const i = 20 of b) { } }"
+PASS Invalid: "for (let i = 20 of b) { }"
+PASS Invalid: "function f() { for (let i = 20 of b) { } }"
+PASS Invalid: "for (let i = 20 in b) { }"
+PASS Invalid: "function f() { for (let i = 20 in b) { } }"
+PASS Invalid: "for (const i = 20 in b) { }"
+PASS Invalid: "function f() { for (const i = 20 in b) { } }"
+PASS Invalid: "for (const {i} = 20 in b) { }"
+PASS Invalid: "function f() { for (const {i} = 20 in b) { } }"
+PASS Invalid: "for (let {i} = 20 in b) { }"
+PASS Invalid: "function f() { for (let {i} = 20 in b) { } }"
</ins><span class="cx"> try statement
</span><span class="cx"> PASS Invalid: "try { break } catch(e) {}"
</span><span class="cx"> PASS Invalid: "function f() { try { break } catch(e) {} }"
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsparsersyntaxcheckjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/parser-syntax-check.js (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/parser-syntax-check.js        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/LayoutTests/js/script-tests/parser-syntax-check.js        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -344,6 +344,21 @@
</span><span class="cx"> invalid("for (var a = (b in c in d) break");
</span><span class="cx"> invalid("for (var (a) in b) { }");
</span><span class="cx"> valid ("for (var a = 7, b = c < d >= d ; f()[6]++ ; --i()[1]++ ) {}");
</span><ins>+invalid("for (var {a} = 20 in b) { }");
+invalid("for (var {a} = 20 of b) { }");
+invalid("for (var {a} = 20 in b) { }");
+valid("for (var i = 20 in b) { }");
+invalid("for (var i = 20 of b) { }");
+invalid("for (var {i} = 20 of b) { }");
+invalid("for (var [i] = 20 of b) { }");
+invalid("for (let [i] = 20 of b) { }");
+invalid("for (const [i] = 20 of b) { }");
+invalid("for (const i = 20 of b) { }");
+invalid("for (let i = 20 of b) { }");
+invalid("for (let i = 20 in b) { }");
+invalid("for (const i = 20 in b) { }");
+invalid("for (const {i} = 20 in b) { }");
+invalid("for (let {i} = 20 in b) { }");
</ins><span class="cx">
</span><span class="cx"> debug ("try statement");
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2016-03-14 Saam barati <sbarati@apple.com>
+
+ assignments in for-in/for-of header not allowed
+ https://bugs.webkit.org/show_bug.cgi?id=155384
+
+ Reviewed by Darin Adler.
+
+ This patch prevents assignments to the loop variable
+ in for in/of loops in all but one situation. The following
+ syntax is still allowed even though the spec prevents it:
+ ```
+ for (var i = X in blah) ;
+ ```
+ If the loop contains let/const, destructuring, or is a for-of
+ loop, we always throw a syntax error if there is an assignment.
+ We can do this with full backwards compatibility.
+ We only allow the above type of for-in loops because Oliver told
+ me that when he tried to make such programs illegal he ran
+ into real websites breaking.
+
+ This patch also removed the !::CreatesAST compile-time branch when checking
+ assignments to new.target. This was a dangerous thing for me
+ to introduce into our parser. There are times where ::CreatesAST
+ is true but we also want to check for syntax errors. For example,
+ when parsing the top-level AST of a program. Though this check
+ was technically correct, it's dangerous to have. It was correct
+ because we would always be reparsing the new.target assignment
+ because new.target is only allowed inside a function. That made it
+ so that (!::CreatesAST <=> we care about new.target assignment syntax errors).
+ But, (!::CreatesAST <=> we care about syntax error X) is not true in general.
+ I think it's safer to remove such code.
+
+ * parser/ASTBuilder.h:
+ (JSC::ASTBuilder::createNewTargetExpr):
+ (JSC::ASTBuilder::isNewTarget):
+ (JSC::ASTBuilder::createResolve):
+ * parser/Nodes.h:
+ (JSC::ExpressionNode::isBoolean):
+ (JSC::ExpressionNode::isSpreadExpression):
+ (JSC::ExpressionNode::isSuperNode):
+ (JSC::ExpressionNode::isNewTarget):
+ (JSC::ExpressionNode::isBytecodeIntrinsicNode):
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::parseForStatement):
+ (JSC::Parser<LexerType>::parseAssignmentExpression):
+ (JSC::Parser<LexerType>::parseUnaryExpression):
+
</ins><span class="cx"> 2016-03-13 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserASTBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/ASTBuilder.h (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> usesNewTarget();
</span><span class="cx"> return new (m_parserArena) NewTargetNode(location);
</span><span class="cx"> }
</span><del>- NO_RETURN_DUE_TO_CRASH bool isNewTarget(ExpressionNode*) { RELEASE_ASSERT_NOT_REACHED(); }
</del><ins>+ bool isNewTarget(ExpressionNode* node) { return node->isNewTarget(); }
</ins><span class="cx"> ExpressionNode* createResolve(const JSTokenLocation& location, const Identifier& ident, const JSTextPosition& start, const JSTextPosition& end)
</span><span class="cx"> {
</span><span class="cx"> if (m_vm->propertyNames->arguments == ident)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -174,6 +174,7 @@
</span><span class="cx"> virtual bool isBoolean() const { return false; }
</span><span class="cx"> virtual bool isSpreadExpression() const { return false; }
</span><span class="cx"> virtual bool isSuperNode() const { return false; }
</span><ins>+ virtual bool isNewTarget() const { return false; }
</ins><span class="cx"> virtual bool isBytecodeIntrinsicNode() const { return false; }
</span><span class="cx">
</span><span class="cx"> virtual void emitBytecodeInConditionContext(BytecodeGenerator&, Label*, Label*, FallThroughMode);
</span><span class="lines">@@ -560,6 +561,7 @@
</span><span class="cx"> NewTargetNode(const JSTokenLocation&);
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ bool isNewTarget() const final { return true; }
</ins><span class="cx"> RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.cpp (198143 => 198144)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.cpp        2016-03-14 18:29:05 UTC (rev 198143)
+++ trunk/Source/JavaScriptCore/parser/Parser.cpp        2016-03-14 18:38:28 UTC (rev 198144)
</span><span class="lines">@@ -1154,22 +1154,24 @@
</span><span class="cx"> // Remainder of a standard for loop is handled identically
</span><span class="cx"> if (match(SEMICOLON))
</span><span class="cx"> goto standardForLoop;
</span><del>-
</del><ins>+
</ins><span class="cx"> failIfFalse(declarations == 1, "can only declare a single variable in an enumeration");
</span><del>- failIfTrueIfStrict(forInInitializer, "Cannot use initialiser syntax in a strict mode enumeration");
</del><span class="cx">
</span><del>- if (forInInitializer)
- failIfFalse(context.isBindingNode(forInTarget), "Cannot use initialiser syntax when binding to a pattern during enumeration");
-
</del><span class="cx"> // Handle for-in with var declaration
</span><span class="cx"> JSTextPosition inLocation = tokenStartPosition();
</span><span class="cx"> bool isOfEnumeration = false;
</span><span class="cx"> if (!consume(INTOKEN)) {
</span><span class="cx"> failIfFalse(match(IDENT) && *m_token.m_data.ident == m_vm->propertyNames->of, "Expected either 'in' or 'of' in enumeration syntax");
</span><span class="cx"> isOfEnumeration = true;
</span><del>- failIfTrue(forInInitializer, "Cannot use initialiser syntax in a for-of enumeration");
</del><span class="cx"> next();
</span><span class="cx"> }
</span><ins>+ bool hasAnyAssignments = !!forInInitializer;
+ if (hasAnyAssignments) {
+ if (isOfEnumeration)
+ internalFailWithMessage(false, "Cannot assign to the loop variable inside a for-of loop header");
+ if (strictMode() || (isLetDeclaration || isConstDeclaration) || !context.isBindingNode(forInTarget))
+ internalFailWithMessage(false, "Cannot assign to the loop variable inside a for-in loop header");
+ }
</ins><span class="cx"> TreeExpression expr = parseExpression(context);
</span><span class="cx"> failIfFalse(expr, "Expected expression to enumerate");
</span><span class="cx"> JSTextPosition exprEnd = lastTokenEndPosition();
</span><span class="lines">@@ -3044,10 +3046,8 @@
</span><span class="cx"> }
</span><span class="cx"> m_parserState.nonTrivialExpressionCount++;
</span><span class="cx"> hadAssignment = true;
</span><del>- if (!TreeBuilder::CreatesAST) { // We only need to do this check with the syntax checker.
- if (UNLIKELY(context.isNewTarget(lhs)))
- internalFailWithMessage(false, "new.target can't be the left hand side of an assignment expression");
- }
</del><ins>+ if (UNLIKELY(context.isNewTarget(lhs)))
+ internalFailWithMessage(false, "new.target can't be the left hand side of an assignment expression");
</ins><span class="cx"> context.assignmentStackAppend(assignmentStack, lhs, start, tokenStartPosition(), m_parserState.assignmentCount, op);
</span><span class="cx"> start = tokenStartPosition();
</span><span class="cx"> m_parserState.assignmentCount++;
</span><span class="lines">@@ -4009,10 +4009,8 @@
</span><span class="cx"> failWithMessage("Cannot parse subexpression of ", operatorString(true, lastOperator), "operator");
</span><span class="cx"> failWithMessage("Cannot parse member expression");
</span><span class="cx"> }
</span><del>- if (!TreeBuilder::CreatesAST) { // We only need to do this check with the syntax checker.
- if (UNLIKELY(lastOperator && context.isNewTarget(expr)))
- internalFailWithMessage(false, "new.target can't come after a prefix operator");
- }
</del><ins>+ if (UNLIKELY(lastOperator && context.isNewTarget(expr)))
+ internalFailWithMessage(false, "new.target can't come after a prefix operator");
</ins><span class="cx"> bool isEvalOrArguments = false;
</span><span class="cx"> if (strictMode() && !m_syntaxAlreadyValidated) {
</span><span class="cx"> if (context.isResolve(expr))
</span><span class="lines">@@ -4021,10 +4019,8 @@
</span><span class="cx"> failIfTrueIfStrict(isEvalOrArguments && modifiesExpr, "Cannot modify '", m_parserState.lastIdentifier->impl(), "' in strict mode");
</span><span class="cx"> switch (m_token.m_type) {
</span><span class="cx"> case PLUSPLUS:
</span><del>- if (!TreeBuilder::CreatesAST) { // We only need to do this check with the syntax checker.
- if (UNLIKELY(context.isNewTarget(expr)))
- internalFailWithMessage(false, "new.target can't come before a postfix operator");
- }
</del><ins>+ if (UNLIKELY(context.isNewTarget(expr)))
+ internalFailWithMessage(false, "new.target can't come before a postfix operator");
</ins><span class="cx"> m_parserState.nonTrivialExpressionCount++;
</span><span class="cx"> m_parserState.nonLHSCount++;
</span><span class="cx"> expr = context.makePostfixNode(location, expr, OpPlusPlus, subExprStart, lastTokenEndPosition(), tokenEndPosition());
</span><span class="lines">@@ -4035,10 +4031,8 @@
</span><span class="cx"> next();
</span><span class="cx"> break;
</span><span class="cx"> case MINUSMINUS:
</span><del>- if (!TreeBuilder::CreatesAST) { // We only need to do this check with the syntax checker.
- if (UNLIKELY(context.isNewTarget(expr)))
- internalFailWithMessage(false, "new.target can't come before a postfix operator");
- }
</del><ins>+ if (UNLIKELY(context.isNewTarget(expr)))
+ internalFailWithMessage(false, "new.target can't come before a postfix operator");
</ins><span class="cx"> m_parserState.nonTrivialExpressionCount++;
</span><span class="cx"> m_parserState.nonLHSCount++;
</span><span class="cx"> expr = context.makePostfixNode(location, expr, OpMinusMinus, subExprStart, lastTokenEndPosition(), tokenEndPosition());
</span></span></pre>
</div>
</div>
</body>
</html>