Changeset 266322 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Aug 29, 2020, 12:11:42 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r266318 r266322 1 2020-08-28 Yusuke Suzuki <[email protected]> 2 3 [JSC] super property with new should be accepted 4 https://bugs.webkit.org/show_bug.cgi?id=215966 5 6 Reviewed by Ross Kirsling. 7 8 While we should reject `new super` / `new super()`, we should accept `new super.property`. 9 https://tc39.es/ecma262/#prod-SuperProperty is a child production of https://tc39.es/ecma262/#prod-MemberExpression, 10 unlike https://tc39.es/ecma262/#prod-SuperCall. So `new` should accept SuperProperty (e.g. `super.xxx`). 11 12 * parser/Parser.cpp: 13 (JSC::Parser<LexerType>::parseMemberExpression): 14 1 15 2020-08-28 Yusuke Suzuki <[email protected]> 2 16 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r266318 r266322 4844 4844 bool previousBaseWasSuper = false; 4845 4845 bool baseIsImport = match(IMPORT); 4846 semanticFailIfTrue(baseIsSuper && newCount, "Cannot use new with ", getToken());4847 4846 4848 4847 bool baseIsNewTarget = false; … … 4976 4975 if (newCount) { 4977 4976 newCount--; 4977 semanticFailIfTrue(baseIsSuper, "Cannot use new with super call"); 4978 4978 JSTextPosition expressionEnd = lastTokenEndPosition(); 4979 4979 TreeArguments arguments = parseArguments(context); … … 5072 5072 } while (match(QUESTIONDOT)); 5073 5073 5074 semanticFailIfTrue(baseIsSuper, "super is not valid in this context");5074 semanticFailIfTrue(baseIsSuper, newCount ? "Cannot use new with super call" : "super is not valid in this context"); 5075 5075 while (newCount--) 5076 5076 base = context.createNewExpr(location, base, expressionStart, lastTokenEndPosition());
Note:
See TracChangeset
for help on using the changeset viewer.