| Index: src/parsing/preparser.cc
|
| diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
|
| index 27c6d23bbee171a2a0c13569fe36f726615acbae..9790ac693a6e1a2a706276290450411508d821ec 100644
|
| --- a/src/parsing/preparser.cc
|
| +++ b/src/parsing/preparser.cc
|
| @@ -1197,6 +1197,36 @@ PreParserExpression PreParser::ParseDoExpression(bool* ok) {
|
| }
|
| }
|
|
|
| +void PreParserTraits::ParseAsyncArrowSingleExpressionBody(
|
| + PreParserStatementList body, bool accept_IN,
|
| + Type::ExpressionClassifier* classifier, int pos, bool* ok) {
|
| + {
|
| + Scope* generator_scope = pre_parser_->NewScope(
|
| + pre_parser_->scope_, FUNCTION_SCOPE, kAsyncFunction);
|
| +
|
| + // For generators, allocating variables in contexts is currently a win
|
| + // because it minimizes the work needed to suspend and resume an
|
| + // activation. The machine code produced for generators (by
|
| + // full-codegen)
|
| + // relies on this forced context allocation, but not in an essential
|
| + // way.
|
| + generator_scope->ForceContextAllocation();
|
| +
|
| + PreParser::FunctionState generator_state(
|
| + &pre_parser_->function_state_, &pre_parser_->scope_, generator_scope,
|
| + kAsyncFunction, pre_parser_->factory());
|
| + generator_scope->set_start_position(pos);
|
| +
|
| + PreParserExpression return_value =
|
| + pre_parser_->ParseAssignmentExpression(accept_IN, classifier, ok);
|
| + if (!*ok) return;
|
| +
|
| + generator_scope->set_end_position(
|
| + pre_parser_->scanner()->location().end_pos);
|
| + body->Add(PreParserStatement::ExpressionStatement(return_value), zone());
|
| + }
|
| +}
|
| +
|
| #undef CHECK_OK
|
|
|
|
|
|
|