| Index: src/parsing/parser-base.h
|
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
|
| index c7e4daf97c2b555056c1e17d9d7d78d09df19f0f..e0ea18865975885a1002eaccec77b37b658f1592 100644
|
| --- a/src/parsing/parser-base.h
|
| +++ b/src/parsing/parser-base.h
|
| @@ -2322,11 +2322,17 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
|
| }
|
|
|
| if (is_async && peek_any_identifier() && PeekAhead() == Token::ARROW) {
|
| - // async Identifier => AsyncConciseBody
|
| - IdentifierT name =
|
| - ParseAndClassifyIdentifier(&arrow_formals_classifier, CHECK_OK);
|
| - expression = this->ExpressionFromIdentifier(name, position(),
|
| - scanner()->location().end_pos);
|
| + if (this->IsIdentifier(expression)) {
|
| + // async Identifier => AsyncConciseBody
|
| + IdentifierT name =
|
| + ParseAndClassifyIdentifier(&arrow_formals_classifier, CHECK_OK);
|
| + expression = this->ExpressionFromIdentifier(
|
| + name, position(), scanner()->location().end_pos, InferName::No);
|
| + if (fni_) {
|
| + // Remove `async` keyword from inferred name stack.
|
| + fni_->RemoveAsyncKeywordAtIndex(fni_->LastNameIndex());
|
| + }
|
| + }
|
| }
|
|
|
| if (peek() == Token::ARROW) {
|
| @@ -2882,10 +2888,14 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
|
| }
|
| Scanner::Location spread_pos;
|
| typename Traits::Type::ExpressionList args;
|
| - if (V8_UNLIKELY(is_async)) {
|
| + if (V8_UNLIKELY(is_async && this->IsIdentifier(result))) {
|
| + int async_index = fni_ ? fni_->LastNameIndex() : -1;
|
| ExpressionClassifier async_classifier(this);
|
| args = ParseArguments(&spread_pos, true, &async_classifier, CHECK_OK);
|
| if (peek() == Token::ARROW) {
|
| + if (fni_) {
|
| + fni_->RemoveAsyncKeywordAtIndex(async_index);
|
| + }
|
| ValidateBindingPattern(&async_classifier, CHECK_OK);
|
| if (!async_classifier.is_valid_async_arrow_formal_parameters()) {
|
| ReportClassifierError(
|
|
|