Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/parsing/parser.cc

Issue 2667983004: [async-await] don't eagerly resolve Promise before finally blocks have executed
Patch Set: clean merge Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/mjsunit/es8/async-function-try-finally.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/mjsunit/es8/async-function-try-finally.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698