Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 0544b9feb241c9883fac4aed91911135ecb0f2d0..41d42b6101bc3c89830b5d05051dcaf9f4856723 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -121,6 +121,7 @@ PreParser::PreParseResult PreParser::PreParseLazyFunction( |
DCHECK_EQ(Token::LBRACE, scanner()->current_token()); |
bool ok = true; |
int start_position = peek_position(); |
+ function_state.set_parse_phase(FunctionParsePhase::FunctionBody); |
ParseLazyFunctionLiteralBody(&ok, bookmark); |
use_counts_ = nullptr; |
if (bookmark && bookmark->HasBeenReset()) { |
@@ -1105,6 +1106,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
int start_position = scanner()->location().beg_pos; |
function_scope->set_start_position(start_position); |
PreParserFormalParameters formals(function_scope); |
+ function_state.set_parse_phase(FunctionParsePhase::FormalParameters); |
ParseFormalParameterList(&formals, &formals_classifier, CHECK_OK); |
Expect(Token::RPAREN, CHECK_OK); |
int formals_end_position = scanner()->location().end_pos; |
@@ -1117,6 +1119,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
bool is_lazily_parsed = (outer_is_script_scope && allow_lazy() && |
!function_state_->this_function_is_parenthesized()); |
+ function_state.set_parse_phase(FunctionParsePhase::FunctionBody); |
Expect(Token::LBRACE, CHECK_OK); |
if (is_lazily_parsed) { |
ParseLazyFunctionLiteralBody(CHECK_OK); |
@@ -1291,6 +1294,19 @@ PreParserExpression PreParser::ParseDoExpression(bool* ok) { |
return PreParserExpression::Default(); |
} |
+void PreParserTraits::ParseAsyncArrowSingleExpressionBody( |
+ PreParserStatementList body, bool accept_IN, |
+ Type::ExpressionClassifier* classifier, int pos, bool* ok) { |
+ Scope* scope = pre_parser_->scope_; |
+ scope->ForceContextAllocation(); |
+ |
+ PreParserExpression return_value = |
+ pre_parser_->ParseAssignmentExpression(accept_IN, classifier, ok); |
+ if (!*ok) return; |
+ |
+ body->Add(PreParserStatement::ExpressionStatement(return_value), zone()); |
+} |
+ |
#undef CHECK_OK |