Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 60938c7036dc22222409df0c516109dcd8dd233a..970d49dc0ac410994e736bdad7c072a62eb33848 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -401,10 +401,6 @@ bool ParserTraits::IsUndefined(const AstRawString* identifier) const { |
return identifier == parser_->ast_value_factory()->undefined_string(); |
} |
-bool ParserTraits::IsAwait(const AstRawString* identifier) const { |
- return identifier == parser_->ast_value_factory()->await_string(); |
-} |
- |
bool ParserTraits::IsPrototype(const AstRawString* identifier) const { |
return identifier == parser_->ast_value_factory()->prototype_string(); |
} |
@@ -2179,13 +2175,6 @@ Statement* Parser::ParseHoistableDeclaration( |
variable_name = name; |
} |
- if (V8_UNLIKELY(is_async_function() && this->IsAwait(name))) { |
- ReportMessageAt(scanner()->location(), |
- MessageTemplate::kAwaitBindingIdentifier); |
- *ok = false; |
- return nullptr; |
- } |
- |
FuncNameInferrer::State fni_state(fni_); |
if (fni_ != NULL) fni_->PushEnclosingName(name); |
FunctionLiteral* fun = ParseFunctionLiteral( |
@@ -4490,13 +4479,8 @@ Expression* Parser::ParseAsyncFunctionExpression(bool* ok) { |
if (peek_any_identifier()) { |
type = FunctionLiteral::kNamedExpression; |
- name = ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK); |
- if (this->IsAwait(name)) { |
- ReportMessageAt(scanner()->location(), |
- MessageTemplate::kAwaitBindingIdentifier); |
- *ok = false; |
- return nullptr; |
- } |
+ name = ParseIdentifierOrStrictReservedWord(FunctionKind::kAsyncFunction, |
+ &is_strict_reserved, CHECK_OK); |
} |
return ParseFunctionLiteral(name, scanner()->location(), |
is_strict_reserved ? kFunctionNameIsStrictReserved |