| Index: src/compiler/ast-graph-builder.h
|
| diff --git a/src/compiler/ast-graph-builder.h b/src/compiler/ast-graph-builder.h
|
| index 27b8e3063c40d70c0da45aea47b6868e6fcbbbb5..6f218a9d8810122e52c0ba9a3ec3882ed264862c 100644
|
| --- a/src/compiler/ast-graph-builder.h
|
| +++ b/src/compiler/ast-graph-builder.h
|
| @@ -422,12 +422,19 @@ class AstGraphBuilder::ContextScope BASE_EMBEDDED {
|
| outer_(owner->current_context()),
|
| scope_(scope) {
|
| owner_->set_execution_context(this); // Push.
|
| - owner_->set_current_context(context);
|
| + if (context != nullptr) {
|
| + owner_->set_current_context(context);
|
| + need_context = true;
|
| + } else {
|
| + need_context = false;
|
| + }
|
| }
|
|
|
| ~ContextScope() {
|
| owner_->set_execution_context(next_); // Pop.
|
| - owner_->set_current_context(outer_);
|
| + if (need_context) {
|
| + owner_->set_current_context(outer_);
|
| + }
|
| }
|
|
|
| // Current scope during visitation.
|
| @@ -438,6 +445,7 @@ class AstGraphBuilder::ContextScope BASE_EMBEDDED {
|
| ContextScope* next_;
|
| Node* outer_;
|
| Scope* scope_;
|
| + bool need_context;
|
| };
|
|
|
| Scope* AstGraphBuilder::current_scope() const {
|
|
|