Title: [223062] trunk
Revision
223062
Author
[email protected]
Date
2017-10-09 13:02:32 -0700 (Mon, 09 Oct 2017)

Log Message

Unreviewed, rolling out r223022.

This change introduced 18 test262 failures.

Reverted changeset:

"`async` should be able to be used as an imported binding
name"
https://bugs.webkit.org/show_bug.cgi?id=176573
http://trac.webkit.org/changeset/223022

Modified Paths

Removed Paths

Diff

Modified: trunk/JSTests/ChangeLog (223061 => 223062)


--- trunk/JSTests/ChangeLog	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/JSTests/ChangeLog	2017-10-09 20:02:32 UTC (rev 223062)
@@ -1,3 +1,16 @@
+2017-10-09  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r223022.
+
+        This change introduced 18 test262 failures.
+
+        Reverted changeset:
+
+        "`async` should be able to be used as an imported binding
+        name"
+        https://bugs.webkit.org/show_bug.cgi?id=176573
+        http://trac.webkit.org/changeset/223022
+
 2017-10-09  Saam Barati  <[email protected]>
 
         3 poly-proto JSC tests timing out on debug after r222827

Deleted: trunk/JSTests/modules/import-default-async.js (223061 => 223062)


--- trunk/JSTests/modules/import-default-async.js	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/JSTests/modules/import-default-async.js	2017-10-09 20:02:32 UTC (rev 223062)
@@ -1,6 +0,0 @@
-import { shouldBe } from "./resources/assert.js";
-import async from "./import-default-async.js"
-
-export default 42;
-
-shouldBe(async, 42);

Deleted: trunk/JSTests/modules/import-named-async-as.js (223061 => 223062)


--- trunk/JSTests/modules/import-named-async-as.js	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/JSTests/modules/import-named-async-as.js	2017-10-09 20:02:32 UTC (rev 223062)
@@ -1,6 +0,0 @@
-import { shouldBe } from "./resources/assert.js";
-import { Cocoa as async } from "./import-named-async-as.js"
-
-export let Cocoa = 42;
-shouldBe(async, 42);
-shouldBe(Cocoa, 42);

Deleted: trunk/JSTests/modules/import-named-async.js (223061 => 223062)


--- trunk/JSTests/modules/import-named-async.js	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/JSTests/modules/import-named-async.js	2017-10-09 20:02:32 UTC (rev 223062)
@@ -1,4 +0,0 @@
-import { shouldBe } from "./resources/assert.js";
-import { async } from "./import-named-async/target.js"
-
-shouldBe(async, 42);

Deleted: trunk/JSTests/modules/import-namespace-async.js (223061 => 223062)


--- trunk/JSTests/modules/import-namespace-async.js	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/JSTests/modules/import-namespace-async.js	2017-10-09 20:02:32 UTC (rev 223062)
@@ -1,5 +0,0 @@
-import { shouldBe } from "./resources/assert.js";
-import * as async from "./import-namespace-async.js"
-
-export let Cocoa = 42;
-shouldBe(async.Cocoa, 42);

Modified: trunk/Source/_javascript_Core/ChangeLog (223061 => 223062)


--- trunk/Source/_javascript_Core/ChangeLog	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-10-09 20:02:32 UTC (rev 223062)
@@ -1,3 +1,16 @@
+2017-10-09  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r223022.
+
+        This change introduced 18 test262 failures.
+
+        Reverted changeset:
+
+        "`async` should be able to be used as an imported binding
+        name"
+        https://bugs.webkit.org/show_bug.cgi?id=176573
+        http://trac.webkit.org/changeset/223022
+
 2017-10-09  Robin Morisset  <[email protected]>
 
         Make the names of the options consistent

Modified: trunk/Source/_javascript_Core/parser/Keywords.table (223061 => 223062)


--- trunk/Source/_javascript_Core/parser/Keywords.table	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/Source/_javascript_Core/parser/Keywords.table	2017-10-09 20:02:32 UTC (rev 223062)
@@ -7,6 +7,7 @@
 false		FALSETOKEN
 
 # Keywords.
+async       ASYNC
 await       AWAIT
 break		BREAK
 case		CASE

Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (223061 => 223062)


--- trunk/Source/_javascript_Core/parser/Parser.cpp	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp	2017-10-09 20:02:32 UTC (rev 223062)
@@ -657,19 +657,19 @@
     case FUNCTION:
         result = parseFunctionDeclaration(context);
         break;
-    case IDENT:
-        if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-            // Eagerly parse as AsyncFunctionDeclaration. This is the uncommon case,
-            // but could be mistakenly parsed as an AsyncFunctionExpression.
-            SavePoint savePoint = createSavePoint();
-            next();
-            if (UNLIKELY(match(FUNCTION) && !m_lexer->prevTerminator())) {
-                result = parseAsyncFunctionDeclaration(context);
-                break;
-            }
-            restoreSavePoint(savePoint);
+    case ASYNC: {
+        // Eagerly parse as AsyncFunctionDeclaration. This is the uncommon case,
+        // but could be mistakenly parsed as an AsyncFunctionExpression.
+        SavePoint savePoint = createSavePoint();
+        next();
+        if (UNLIKELY(match(FUNCTION) && !m_lexer->prevTerminator())) {
+            result = parseAsyncFunctionDeclaration(context);
+            break;
         }
+        restoreSavePoint(savePoint);
         FALLTHROUGH;
+    }
+    case IDENT:
     case AWAIT:
     case YIELD: {
         // This is a convenient place to notice labeled statements
@@ -1899,12 +1899,11 @@
             goto identcase;
         goto defaultCase;
     }
+    case ASYNC:
+        if (maybeParseAsyncFunctionDeclarationStatement(context, result, parentAllowsFunctionDeclarationAsStatement))
+            break;
+        FALLTHROUGH;
     case IDENT:
-        if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-            if (maybeParseAsyncFunctionDeclarationStatement(context, result, parentAllowsFunctionDeclarationAsStatement))
-                break;
-        }
-        FALLTHROUGH;
     case AWAIT:
     case YIELD: {
         identcase:
@@ -1989,7 +1988,7 @@
 template <typename LexerType>
 template <class TreeBuilder> bool Parser<LexerType>::maybeParseAsyncFunctionDeclarationStatement(TreeBuilder& context, TreeStatement& result, bool parentAllowsFunctionDeclarationAsStatement)
 {
-    ASSERT(matchContextualKeyword(m_vm->propertyNames->async));
+    ASSERT(match(ASYNC));
     SavePoint savePoint = createSavePoint();
     next();
     if (match(FUNCTION) && !m_lexer->prevTerminator()) {
@@ -2836,21 +2835,20 @@
             ASSERT(ident);
             next();
             break;
-        case IDENT:
-            if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-                if (!isGeneratorMethodParseMode(parseMode) && !isAsyncMethodParseMode(parseMode)) {
-                    ident = m_token.m_data.ident;
-                    next();
-                    if (match(OPENPAREN) || match(COLON) || match(EQUAL) || m_lexer->prevTerminator())
-                        break;
-                    if (Options::useAsyncIterator() && UNLIKELY(consume(TIMES)))
-                        parseMode = SourceParseMode::AsyncGeneratorWrapperMethodMode;
-                    else
-                        parseMode = SourceParseMode::AsyncMethodMode;
-                    goto parseMethod;
-                }
+        case ASYNC:
+            if (!isGeneratorMethodParseMode(parseMode) && !isAsyncMethodParseMode(parseMode)) {
+                ident = m_token.m_data.ident;
+                next();
+                if (match(OPENPAREN) || match(COLON) || match(EQUAL) || m_lexer->prevTerminator())
+                    break;
+                if (Options::useAsyncIterator() && UNLIKELY(consume(TIMES)))
+                    parseMode = SourceParseMode::AsyncGeneratorWrapperMethodMode;
+                else
+                    parseMode = SourceParseMode::AsyncMethodMode;
+                goto parseMethod;
             }
             FALLTHROUGH;
+        case IDENT:
         case AWAIT:
             ident = m_token.m_data.ident;
             ASSERT(ident);
@@ -3371,7 +3369,7 @@
             if (match(IDENT))
                 localName = m_token.m_data.ident;
             restoreSavePoint(savePoint);
-        } else if (matchContextualKeyword(m_vm->propertyNames->async)) {
+        } else if (match(ASYNC)) {
             SavePoint savePoint = createSavePoint();
             next();
             if (match(FUNCTION) && !m_lexer->prevTerminator()) {
@@ -3395,7 +3393,7 @@
             } else if (match(CLASSTOKEN)) {
                 result = parseClassDeclaration(context, ExportType::NotExported, DeclarationDefaultContext::ExportDefault);
             } else {
-                ASSERT(matchContextualKeyword(m_vm->propertyNames->async));
+                ASSERT(match(ASYNC));
                 next();
                 DepthManager statementDepth(&m_statementDepth);
                 m_statementDepth = 1;
@@ -3516,16 +3514,15 @@
             result = parseClassDeclaration(context, ExportType::Exported);
             break;
 
-        case IDENT:
-            if (*m_token.m_data.ident == m_vm->propertyNames->async) {
-                next();
-                semanticFailIfFalse(match(FUNCTION) && !m_lexer->prevTerminator(), "Expected 'function' keyword following 'async' keyword with no preceding line terminator");
-                DepthManager statementDepth(&m_statementDepth);
-                m_statementDepth = 1;
-                result = parseAsyncFunctionDeclaration(context, ExportType::Exported);
-                break;
-            }
-            FALLTHROUGH;
+        case ASYNC: {
+            next();
+            semanticFailIfFalse(match(FUNCTION) && !m_lexer->prevTerminator(), "Expected 'function' keyword following 'async' keyword with no preceding line terminator");
+            DepthManager statementDepth(&m_statementDepth);
+            m_statementDepth = 1;
+            result = parseAsyncFunctionDeclaration(context, ExportType::Exported);
+            break;
+        }
+
         default:
             failWithMessage("Expected either a declaration or a variable statement");
             break;
@@ -3623,7 +3620,7 @@
             restoreSavePoint(savePoint);
             bool isAsyncArrow = false;
             if (UNLIKELY(classifier.indicatesPossibleAsyncArrowFunction())) {
-                ASSERT(matchContextualKeyword(m_vm->propertyNames->async));
+                ASSERT(match(ASYNC));
                 next();
                 isAsyncArrow = !m_lexer->prevTerminator();
             }
@@ -3891,27 +3888,26 @@
 
 parseProperty:
     switch (m_token.m_type) {
-    case IDENT:
-        if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-            if (parseMode == SourceParseMode::MethodMode) {
-                SavePoint savePoint = createSavePoint();
-                next();
+    case ASYNC:
+        if (parseMode == SourceParseMode::MethodMode) {
+            SavePoint savePoint = createSavePoint();
+            next();
 
-                if (match(COLON) || match(OPENPAREN) || match(COMMA) || match(CLOSEBRACE)) {
-                    restoreSavePoint(savePoint);
-                    wasIdent = true;
-                    goto namedProperty;
-                }
+            if (match(COLON) || match(OPENPAREN) || match(COMMA) || match(CLOSEBRACE)) {
+                restoreSavePoint(savePoint);
+                wasIdent = true;
+                goto namedProperty;
+            }
 
-                failIfTrue(m_lexer->prevTerminator(), "Expected a property name following keyword 'async'");
-                if (Options::useAsyncIterator() && UNLIKELY(consume(TIMES)))
-                    parseMode = SourceParseMode::AsyncGeneratorWrapperMethodMode;
-                else
-                    parseMode = SourceParseMode::AsyncMethodMode;
-                goto parseProperty;
-            }
+            failIfTrue(m_lexer->prevTerminator(), "Expected a property name following keyword 'async'");
+            if (Options::useAsyncIterator() && UNLIKELY(consume(TIMES)))
+                parseMode = SourceParseMode::AsyncGeneratorWrapperMethodMode;
+            else
+                parseMode = SourceParseMode::AsyncMethodMode;
+            goto parseProperty;
         }
         FALLTHROUGH;
+    case IDENT:
     case YIELD:
     case AWAIT:
         wasIdent = true;
@@ -4452,22 +4448,22 @@
             return parseAwaitExpression(context);
 
         goto identifierExpression;
-    case IDENT: {
-        if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-            JSTextPosition start = tokenStartPosition();
-            const Identifier* ident = m_token.m_data.ident;
-            JSTokenLocation location(tokenLocation());
-            next();
-            if (match(FUNCTION) && !m_lexer->prevTerminator())
-                return parseAsyncFunctionExpression(context);
+    case ASYNC: {
+        JSTextPosition start = tokenStartPosition();
+        const Identifier* ident = m_token.m_data.ident;
+        JSTokenLocation location(tokenLocation());
+        next();
+        if (match(FUNCTION) && !m_lexer->prevTerminator())
+            return parseAsyncFunctionExpression(context);
 
-            // Avoid using variable if it is an arrow function parameter
-            if (UNLIKELY(match(ARROWFUNCTION)))
-                return 0;
+        // Avoid using variable if it is an arrow function parameter
+        if (UNLIKELY(match(ARROWFUNCTION)))
+            return 0;
 
-            const bool isEval = false;
-            return createResolveAndUseVariable(context, ident, isEval, start, location);
-        }
+        const bool isEval = false;
+        return createResolveAndUseVariable(context, ident, isEval, start, location);
+    }
+    case IDENT: {
     identifierExpression:
         JSTextPosition start = tokenStartPosition();
         const Identifier* ident = m_token.m_data.ident;
@@ -4714,7 +4710,7 @@
             base = context.createImportExpr(location, expr, expressionStart, expressionEnd, lastTokenEndPosition());
         }
     } else if (!baseIsNewTarget) {
-        const bool isAsync = matchContextualKeyword(m_vm->propertyNames->async);
+        const bool isAsync = match(ASYNC);
 
         base = parsePrimaryExpression(context);
         failIfFalse(base, "Cannot parse base _expression_");
@@ -5071,6 +5067,7 @@
         out.print("Invalid private name '", getToken(), "'");
         return;
             
+    case ASYNC:
     case AWAIT:
     case IDENT:
         out.print("Unexpected identifier '", getToken(), "'");

Modified: trunk/Source/_javascript_Core/parser/ParserTokens.h (223061 => 223062)


--- trunk/Source/_javascript_Core/parser/ParserTokens.h	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/Source/_javascript_Core/parser/ParserTokens.h	2017-10-09 20:02:32 UTC (rev 223062)
@@ -93,9 +93,10 @@
     LET,
     YIELD,
     AWAIT,
+    ASYNC,
 
     FirstContextualKeywordToken = LET,
-    LastContextualKeywordToken = AWAIT,
+    LastContextualKeywordToken = ASYNC,
     FirstSafeContextualKeywordToken = AWAIT,
     LastSafeContextualKeywordToken = LastContextualKeywordToken,
 

Modified: trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h (223061 => 223062)


--- trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h	2017-10-09 20:01:15 UTC (rev 223061)
+++ trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h	2017-10-09 20:02:32 UTC (rev 223062)
@@ -79,7 +79,6 @@
     macro(arguments) \
     macro(as) \
     macro(assign) \
-    macro(async) \
     macro(back) \
     macro(bind) \
     macro(buffer) \
@@ -220,6 +219,7 @@
     macro(year)
 
 #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
+    macro(async) \
     macro(await) \
     macro(break) \
     macro(case) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to