Changeset 266324 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Aug 29, 2020, 1:38:09 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r266323 r266324 1 2020-08-28 Yusuke Suzuki <[email protected]> 2 3 [JSC] for-of / for-in left-hand-side target should be simple-assignment-target 4 https://bugs.webkit.org/show_bug.cgi?id=215969 5 6 Reviewed by Ross Kirsling. 7 8 Left-hand-side of `for-in`, `for-of`, and `for-await-of` should be simple assignment target[1] 9 if the target is not declaration and not destructuring pattern. 10 11 [1]: https://tc39.es/ecma262/#sec-for-in-and-for-of-statements-static-semantics-early-errors 12 13 * parser/Parser.cpp: 14 (JSC::Parser<LexerType>::parseForStatement): 15 * parser/SyntaxChecker.h: 16 (JSC::SyntaxChecker::createCommaExpr): Should return CommaExpr to align it to ASTBuilder. 17 (JSC::SyntaxChecker::appendToCommaExpr): 18 (JSC::SyntaxChecker::appendStatement): 19 (JSC::SyntaxChecker::combineCommaNodes): Deleted since it is not used. 20 1 21 2020-08-28 Yusuke Suzuki <[email protected]> 2 22 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r266322 r266324 1543 1543 return result; 1544 1544 } 1545 1546 semanticFailIfFalse(isSimpleAssignmentTarget(context, decls), "Left side of assignment is not a reference"); 1545 1547 if (isOfEnumeration) 1546 1548 result = context.createForOfLoop(isAwaitFor, location, decls, expr, statement, declLocation, declsStart, declsEnd, exprEnd, startLine, endLine, *lexicalVariables); -
trunk/Source/JavaScriptCore/parser/SyntaxChecker.h
r266264 r266324 148 148 int createSourceElements() { return SourceElementsResult; } 149 149 ExpressionType makeFunctionCallNode(const JSTokenLocation&, ExpressionType, bool, int, int, int, int, size_t, bool) { return CallExpr; } 150 ExpressionType createCommaExpr(const JSTokenLocation&, ExpressionType expr) { return expr; }151 ExpressionType appendToCommaExpr(const JSTokenLocation&, ExpressionType & head, ExpressionType, ExpressionType next) { head = next; return next; }150 ExpressionType createCommaExpr(const JSTokenLocation&, ExpressionType) { return CommaExpr; } 151 ExpressionType appendToCommaExpr(const JSTokenLocation&, ExpressionType, ExpressionType, ExpressionType) { return CommaExpr; } 152 152 ExpressionType makeAssignNode(const JSTokenLocation&, ExpressionType, Operator, ExpressionType, bool, bool, int, int, int) { return AssignmentExpr; } 153 153 ExpressionType makePrefixNode(const JSTokenLocation&, ExpressionType, Operator, int, int, int) { return PreExpr; } … … 302 302 303 303 void appendStatement(int, int) { } 304 int combineCommaNodes(const JSTokenLocation&, int, int) { return CommaExpr; }305 304 int evalCount() const { return 0; } 306 305 void appendBinaryExpressionInfo(int& operandStackDepth, int expr, int, int, int, bool)
Note:
See TracChangeset
for help on using the changeset viewer.