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

Unified Diff: src/parsing/parser.cc

Issue 2685683002: [async-await] (simpler) fix for Return in try/finally in async functions (Closed)
Patch Set: also shrink the bitfield for ReturnStatement::Type Created 3 years, 10 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') | src/parsing/parser-base.h » ('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 4c553d8ae48f35510ce803399c65669449da6012..c73dc46136e6961f5f01b6701ac5cb146f21cbe5 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1615,8 +1615,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;
}
@@ -2479,9 +2477,8 @@ void Parser::PrepareGeneratorVariables() {
// Calling a generator returns a generator object. That object is stored
// in a temporary variable, a definition that is used by "yield"
// expressions.
- Variable* temp =
- NewTemporary(ast_value_factory()->dot_generator_object_string());
- function_state_->set_generator_object_variable(temp);
+ function_state_->scope()->DeclareGeneratorObjectVar(
+ ast_value_factory()->dot_generator_object_string());
}
FunctionLiteral* Parser::ParseFunctionLiteral(
@@ -3095,8 +3092,8 @@ Variable* Parser::PromiseVariable() {
// comes first should create it and stash it in the FunctionState.
Variable* promise = function_state_->promise_variable();
if (function_state_->promise_variable() == nullptr) {
- promise = scope()->NewTemporary(ast_value_factory()->empty_string());
- function_state_->set_promise_variable(promise);
+ promise = function_state_->scope()->DeclarePromiseVar(
+ ast_value_factory()->empty_string());
}
return promise;
}
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698