Title: [271423] trunk
- Revision
- 271423
- Author
- [email protected]
- Date
- 2021-01-12 16:15:53 -0800 (Tue, 12 Jan 2021)
Log Message
[JSC] Class names must be lexed as strict mode code
https://bugs.webkit.org/show_bug.cgi?id=220567
Reviewed by Yusuke Suzuki.
JSTests:
* test262/expectations.yaml:
Mark four test cases as passing.
Source/_javascript_Core:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):
Don't lex next token until *after* we've set up the class scope.
Modified Paths
Diff
Modified: trunk/JSTests/ChangeLog (271422 => 271423)
--- trunk/JSTests/ChangeLog 2021-01-13 00:09:16 UTC (rev 271422)
+++ trunk/JSTests/ChangeLog 2021-01-13 00:15:53 UTC (rev 271423)
@@ -1,3 +1,13 @@
+2021-01-12 Ross Kirsling <[email protected]>
+
+ [JSC] Class names must be lexed as strict mode code
+ https://bugs.webkit.org/show_bug.cgi?id=220567
+
+ Reviewed by Yusuke Suzuki.
+
+ * test262/expectations.yaml:
+ Mark four test cases as passing.
+
2021-01-12 Yusuke Suzuki <[email protected]>
[JSC] Bypass OperationPtrTagging for JITCage verification for CallDOMGetter
Modified: trunk/JSTests/test262/expectations.yaml (271422 => 271423)
--- trunk/JSTests/test262/expectations.yaml 2021-01-13 00:09:16 UTC (rev 271422)
+++ trunk/JSTests/test262/expectations.yaml 2021-01-13 00:15:53 UTC (rev 271423)
@@ -1484,10 +1484,6 @@
test/language/expressions/class/class-name-ident-await.js:
default: "SyntaxError: Unexpected identifier 'await'. Expected opening '{' at the start of a class body."
strict mode: "SyntaxError: Unexpected identifier 'await'. Expected opening '{' at the start of a class body."
-test/language/expressions/class/class-name-ident-static-escaped.js:
- default: 'Test262: This statement should not be evaluated.'
-test/language/expressions/class/class-name-ident-static.js:
- default: 'Test262: This statement should not be evaluated.'
test/language/expressions/class/elements/arrow-body-direct-eval-err-contains-arguments.js:
default: 'Test262Error: Expected a SyntaxError but got a ReferenceError'
strict mode: 'Test262Error: Expected a SyntaxError but got a ReferenceError'
@@ -1743,10 +1739,6 @@
test/language/statements/class/class-name-ident-await.js:
default: "SyntaxError: Unexpected identifier 'await'"
strict mode: "SyntaxError: Unexpected identifier 'await'"
-test/language/statements/class/class-name-ident-static-escaped.js:
- default: 'Test262: This statement should not be evaluated.'
-test/language/statements/class/class-name-ident-static.js:
- default: 'Test262: This statement should not be evaluated.'
test/language/statements/class/elements/arrow-body-direct-eval-err-contains-arguments.js:
default: 'Test262Error: Expected a SyntaxError but got a ReferenceError'
strict mode: 'Test262Error: Expected a SyntaxError but got a ReferenceError'
Modified: trunk/Source/_javascript_Core/ChangeLog (271422 => 271423)
--- trunk/Source/_javascript_Core/ChangeLog 2021-01-13 00:09:16 UTC (rev 271422)
+++ trunk/Source/_javascript_Core/ChangeLog 2021-01-13 00:15:53 UTC (rev 271423)
@@ -1,3 +1,14 @@
+2021-01-12 Ross Kirsling <[email protected]>
+
+ [JSC] Class names must be lexed as strict mode code
+ https://bugs.webkit.org/show_bug.cgi?id=220567
+
+ Reviewed by Yusuke Suzuki.
+
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::parseClass):
+ Don't lex next token until *after* we've set up the class scope.
+
2021-01-12 Yusuke Suzuki <[email protected]>
[JSC] Bypass OperationPtrTagging for JITCage verification for CallDOMGetter
Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (271422 => 271423)
--- trunk/Source/_javascript_Core/parser/Parser.cpp 2021-01-13 00:09:16 UTC (rev 271422)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp 2021-01-13 00:15:53 UTC (rev 271423)
@@ -2851,12 +2851,12 @@
info.startLine = location.line;
info.startColumn = tokenColumn();
info.startOffset = location.startOffset;
- next();
AutoPopScopeRef classScope(this, pushScope());
classScope->setIsLexicalScope();
classScope->preventVarDeclarations();
classScope->setStrictMode();
+ next();
ASSERT_WITH_MESSAGE(requirements != FunctionNameRequirements::Unnamed, "Currently, there is no caller that uses FunctionNameRequirements::Unnamed for class syntax.");
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.");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes