Title: [229162] trunk
- Revision
- 229162
- Author
- [email protected]
- Date
- 2018-03-01 21:55:39 -0800 (Thu, 01 Mar 2018)
Log Message
ASSERTION FAILED: matchContextualKeyword(m_vm->propertyNames->async)
https://bugs.webkit.org/show_bug.cgi?id=183173
Reviewed by Saam Barati.
JSTests:
* stress/async-arrow-function-in-class-heritage.js: Added.
(testSyntax):
(testSyntaxError):
(SyntaxError):
Source/_javascript_Core:
Classifier could propagate an error which does not occur at the first token
of the given _expression_. We should check whether the given token is "async"
instead of assertion.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
Modified Paths
Added Paths
Diff
Modified: trunk/JSTests/ChangeLog (229161 => 229162)
--- trunk/JSTests/ChangeLog 2018-03-02 05:00:06 UTC (rev 229161)
+++ trunk/JSTests/ChangeLog 2018-03-02 05:55:39 UTC (rev 229162)
@@ -1,3 +1,15 @@
+2018-03-01 Yusuke Suzuki <[email protected]>
+
+ ASSERTION FAILED: matchContextualKeyword(m_vm->propertyNames->async)
+ https://bugs.webkit.org/show_bug.cgi?id=183173
+
+ Reviewed by Saam Barati.
+
+ * stress/async-arrow-function-in-class-heritage.js: Added.
+ (testSyntax):
+ (testSyntaxError):
+ (SyntaxError):
+
2018-03-01 Saam Barati <[email protected]>
We need to clear cached structures when having a bad time
Added: trunk/JSTests/stress/async-arrow-function-in-class-heritage.js (0 => 229162)
--- trunk/JSTests/stress/async-arrow-function-in-class-heritage.js (rev 0)
+++ trunk/JSTests/stress/async-arrow-function-in-class-heritage.js 2018-03-02 05:55:39 UTC (rev 229162)
@@ -0,0 +1,25 @@
+function testSyntax(script) {
+ try {
+ eval(script);
+ } catch (error) {
+ if (error instanceof SyntaxError)
+ throw new Error("Bad error: " + String(error));
+ }
+}
+
+function testSyntaxError(script, message) {
+ var error = null;
+ try {
+ eval(script);
+ } catch (e) {
+ error = e;
+ }
+ if (!error)
+ throw new Error("Expected syntax error not thrown");
+
+ if (String(error) !== message)
+ throw new Error("Bad error: " + String(error));
+}
+
+testSyntaxError(`void class extends async()=>{} {}`, `SyntaxError: Unexpected token '=>'`);
+testSyntaxError(`void class extends (async()=>{}) {}`, `TypeError: The value of the superclass's prototype property is not an object.`);
Modified: trunk/Source/_javascript_Core/ChangeLog (229161 => 229162)
--- trunk/Source/_javascript_Core/ChangeLog 2018-03-02 05:00:06 UTC (rev 229161)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-03-02 05:55:39 UTC (rev 229162)
@@ -1,3 +1,17 @@
+2018-03-01 Yusuke Suzuki <[email protected]>
+
+ ASSERTION FAILED: matchContextualKeyword(m_vm->propertyNames->async)
+ https://bugs.webkit.org/show_bug.cgi?id=183173
+
+ Reviewed by Saam Barati.
+
+ Classifier could propagate an error which does not occur at the first token
+ of the given _expression_. We should check whether the given token is "async"
+ instead of assertion.
+
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::parseAssignmentExpression):
+
2018-03-01 Saam Barati <[email protected]>
We need to clear cached structures when having a bad time
Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (229161 => 229162)
--- trunk/Source/_javascript_Core/parser/Parser.cpp 2018-03-02 05:00:06 UTC (rev 229161)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp 2018-03-02 05:55:39 UTC (rev 229162)
@@ -3637,9 +3637,10 @@
restoreSavePoint(savePoint);
bool isAsyncArrow = false;
if (UNLIKELY(classifier.indicatesPossibleAsyncArrowFunction())) {
- ASSERT(matchContextualKeyword(m_vm->propertyNames->async));
- next();
- isAsyncArrow = !m_lexer->prevTerminator();
+ if (matchContextualKeyword(m_vm->propertyNames->async)) {
+ next();
+ isAsyncArrow = !m_lexer->prevTerminator();
+ }
}
if (isArrowFunctionParameters()) {
if (wasOpenParen)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes