Title: [229271] releases/WebKitGTK/webkit-2.20
Revision
229271
Author
[email protected]
Date
2018-03-05 05:16:55 -0800 (Mon, 05 Mar 2018)

Log Message

Merge r229162 - 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: releases/WebKitGTK/webkit-2.20/JSTests/ChangeLog (229270 => 229271)


--- releases/WebKitGTK/webkit-2.20/JSTests/ChangeLog	2018-03-05 13:16:46 UTC (rev 229270)
+++ releases/WebKitGTK/webkit-2.20/JSTests/ChangeLog	2018-03-05 13:16:55 UTC (rev 229271)
@@ -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: releases/WebKitGTK/webkit-2.20/JSTests/stress/async-arrow-function-in-class-heritage.js (0 => 229271)


--- releases/WebKitGTK/webkit-2.20/JSTests/stress/async-arrow-function-in-class-heritage.js	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.20/JSTests/stress/async-arrow-function-in-class-heritage.js	2018-03-05 13:16:55 UTC (rev 229271)
@@ -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: releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/ChangeLog (229270 => 229271)


--- releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/ChangeLog	2018-03-05 13:16:46 UTC (rev 229270)
+++ releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/ChangeLog	2018-03-05 13:16:55 UTC (rev 229271)
@@ -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: releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/parser/Parser.cpp (229270 => 229271)


--- releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/parser/Parser.cpp	2018-03-05 13:16:46 UTC (rev 229270)
+++ releases/WebKitGTK/webkit-2.20/Source/_javascript_Core/parser/Parser.cpp	2018-03-05 13:16:55 UTC (rev 229271)
@@ -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

Reply via email to