Changeset 266340 in webkit for trunk/Source/JavaScriptCore/parser/Parser.cpp
- Timestamp:
- Aug 30, 2020, 6:26:30 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Parser.cpp
r266327 r266340 1983 1983 case IDENT: 1984 1984 if (UNLIKELY(*m_token.m_data.ident == m_vm.propertyNames->async && !m_token.m_data.escaped)) { 1985 if (maybeParseAsyncFunctionDeclarationStatement(context, result, parentAllowsFunctionDeclarationAsStatement)) 1986 break; 1985 SavePoint savePoint = createSavePoint(context); 1986 next(); 1987 failIfTrue(match(FUNCTION) && !m_lexer->hasLineTerminatorBeforeToken(), "Cannot use async function declaration in single-statement context"); 1988 restoreSavePoint(context, savePoint); 1987 1989 } 1988 1990 FALLTHROUGH; … … 2066 2068 popScope(blockScope, TreeBuilder::NeedsFreeVariableInfo); 2067 2069 return result; 2068 }2069 2070 template <typename LexerType>2071 template <class TreeBuilder> bool Parser<LexerType>::maybeParseAsyncFunctionDeclarationStatement(TreeBuilder& context, TreeStatement& result, bool parentAllowsFunctionDeclarationAsStatement)2072 {2073 ASSERT(matchContextualKeyword(m_vm.propertyNames->async));2074 SavePoint savePoint = createSavePoint(context);2075 next();2076 if (match(FUNCTION) && !m_lexer->hasLineTerminatorBeforeToken()) {2077 const bool isAsync = true;2078 result = parseFunctionDeclarationStatement(context, isAsync, parentAllowsFunctionDeclarationAsStatement);2079 return true;2080 }2081 restoreSavePoint(context, savePoint);2082 return false;2083 2070 } 2084 2071
Note:
See TracChangeset
for help on using the changeset viewer.