Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index d42cb0c49a3b90dd84b6bb61b04ca88f523826b1..610bf5562dd026da87dc57ad69e4daabd8bbd745 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -1611,8 +1611,6 @@ Expression* Parser::RewriteReturn(Expression* return_value, int pos) { |
} |
if (is_generator()) { |
return_value = BuildIteratorResult(return_value, true); |
- } else if (is_async_function()) { |
- return_value = BuildResolvePromise(return_value, return_value->position()); |
} |
return return_value; |
} |
@@ -3647,6 +3645,9 @@ void Parser::PrepareAsyncFunctionBody(ZoneList<Statement*>* body, |
if (function_state_->generator_object_variable() == nullptr) { |
PrepareGeneratorVariables(); |
} |
+ Variable* promise_var = PromiseVariable(); |
+ DCHECK_NOT_NULL(promise_var); |
+ USE(promise_var); |
} |
// This method completes the desugaring of the body of async_function. |
@@ -3660,7 +3661,6 @@ void Parser::RewriteAsyncFunctionBody(ZoneList<Statement*>* body, |
// }) |
// } |
- return_value = BuildResolvePromise(return_value, return_value->position()); |
body->Add( |
factory()->NewReturnStatement(return_value, return_value->position()), |
zone()); |