Changeset 271432 in webkit
- Timestamp:
- Jan 12, 2021, 11:04:32 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/test262/expectations.yaml (modified) (2 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/parser/Parser.cpp (modified) (1 diff)
-
Source/JavaScriptCore/parser/Parser.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r271423 r271432 1 2021-01-12 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] Class name 'await' is valid in sync context 4 https://bugs.webkit.org/show_bug.cgi?id=220575 5 6 Reviewed by Yusuke Suzuki. 7 8 * test262/expectations.yaml: 9 Mark four test cases as passing. 10 1 11 2021-01-12 Ross Kirsling <ross.kirsling@sony.com> 2 12 -
trunk/JSTests/test262/expectations.yaml
r271423 r271432 1482 1482 default: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" 1483 1483 strict mode: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" 1484 test/language/expressions/class/class-name-ident-await.js:1485 default: "SyntaxError: Unexpected identifier 'await'. Expected opening '{' at the start of a class body."1486 strict mode: "SyntaxError: Unexpected identifier 'await'. Expected opening '{' at the start of a class body."1487 1484 test/language/expressions/class/elements/arrow-body-direct-eval-err-contains-arguments.js: 1488 1485 default: 'Test262Error: Expected a SyntaxError but got a ReferenceError' … … 1737 1734 default: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" 1738 1735 strict mode: "SyntaxError: Unexpected escaped characters in keyword token: 'aw\\u0061it'" 1739 test/language/statements/class/class-name-ident-await.js:1740 default: "SyntaxError: Unexpected identifier 'await'"1741 strict mode: "SyntaxError: Unexpected identifier 'await'"1742 1736 test/language/statements/class/elements/arrow-body-direct-eval-err-contains-arguments.js: 1743 1737 default: 'Test262Error: Expected a SyntaxError but got a ReferenceError' -
trunk/Source/JavaScriptCore/ChangeLog
r271423 r271432 1 2021-01-12 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] Class name 'await' is valid in sync context 4 https://bugs.webkit.org/show_bug.cgi?id=220575 5 6 Reviewed by Yusuke Suzuki. 7 8 * parser/Parser.cpp: 9 (JSC::Parser<LexerType>::parseClass): 10 Check for valid 'await'. 11 12 * parser/Parser.h: 13 (JSC::Parser::isDisallowedIdentifierAwait): 14 Fix mistake -- we care if the containing function is async, we don't care about being *at* function scope. 15 1 16 2021-01-12 Ross Kirsling <ross.kirsling@sony.com> 2 17 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r271423 r271432 2861 2861 ASSERT_WITH_MESSAGE(requirements != FunctionNameRequirements::Unnamed, "Currently, there is no caller that uses FunctionNameRequirements::Unnamed for class syntax."); 2862 2862 ASSERT_WITH_MESSAGE(!(requirements == FunctionNameRequirements::None && !info.className), "When specifying FunctionNameRequirements::None, we need to initialize info.className with the default value in the caller side."); 2863 if (match(IDENT) ) {2863 if (match(IDENT) || (match(AWAIT) && !isDisallowedIdentifierAwait(m_token))) { 2864 2864 info.className = m_token.m_data.ident; 2865 2865 next(); -
trunk/Source/JavaScriptCore/parser/Parser.h
r270923 r271432 1843 1843 bool isDisallowedIdentifierAwait(const JSToken& token) 1844 1844 { 1845 return token.m_type == AWAIT && (!m_parserState.allowAwait || currentScope()->isAsyncFunction Boundary() || m_scriptMode == JSParserScriptMode::Module);1845 return token.m_type == AWAIT && (!m_parserState.allowAwait || currentScope()->isAsyncFunction() || m_scriptMode == JSParserScriptMode::Module); 1846 1846 } 1847 1847
Note:
See TracChangeset
for help on using the changeset viewer.