Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index e1e3d3412281a274f2a3d03079735cc7c113a2de..3553b9fb1d17d44c28122773d43908030aeb2445 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -438,7 +438,7 @@ class ParserBase { |
} |
void set_promise_variable(typename Types::Variable* variable) { |
- DCHECK(variable != NULL); |
+ DCHECK_NOT_NULL(variable); |
DCHECK(IsAsyncFunction(kind())); |
promise_variable_ = variable; |
} |
@@ -446,6 +446,15 @@ class ParserBase { |
return promise_variable_; |
} |
+ void set_async_return_variable(typename Types::Variable* variable) { |
+ DCHECK_NOT_NULL(variable); |
+ DCHECK(IsAsyncFunction(kind())); |
+ async_return_variable_ = variable; |
+ } |
+ typename Types::Variable* async_return_variable() const { |
+ return async_return_variable_; |
+ } |
+ |
const ZoneList<DestructuringAssignment>& |
destructuring_assignments_to_rewrite() const { |
return destructuring_assignments_to_rewrite_; |
@@ -515,6 +524,8 @@ class ParserBase { |
// For async functions, this variable holds a temporary for the Promise |
// being created as output of the async function. |
Variable* promise_variable_; |
+ Variable* async_return_variable_; |
+ Variable* is_rejection_variable_; |
FunctionState** function_state_stack_; |
FunctionState* outer_function_state_; |
@@ -1518,6 +1529,8 @@ ParserBase<Impl>::FunctionState::FunctionState( |
expected_property_count_(0), |
generator_object_variable_(nullptr), |
promise_variable_(nullptr), |
+ async_return_variable_(nullptr), |
+ is_rejection_variable_(nullptr), |
function_state_stack_(function_state_stack), |
outer_function_state_(*function_state_stack), |
destructuring_assignments_to_rewrite_(16, scope->zone()), |
@@ -4054,7 +4067,8 @@ void ParserBase<Impl>::ParseFunctionBody( |
// TODO(littledan): Merge the two rejection blocks into one |
if (IsAsyncFunction(kind)) { |
- init_block = impl()->BuildRejectPromiseOnException(init_block); |
+ init_block = |
+ impl()->BuildRejectPromiseOnExceptionForParameters(init_block); |
} |
inner_scope->set_end_position(scanner()->location().end_pos); |