| Index: src/compiler/ast-graph-builder.cc
|
| diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
|
| index 0476aed3144084a7d309289bc55fbe261fca618d..706d2efc13d07ee65cb850842829313a39594ae5 100644
|
| --- a/src/compiler/ast-graph-builder.cc
|
| +++ b/src/compiler/ast-graph-builder.cc
|
| @@ -458,15 +458,15 @@ AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
|
|
|
|
|
| Node* AstGraphBuilder::GetFunctionClosureForContext() {
|
| - Scope* declaration_scope = current_scope()->DeclarationScope();
|
| - if (declaration_scope->is_script_scope() ||
|
| - declaration_scope->is_module_scope()) {
|
| + Scope* closure_scope = current_scope()->ClosureScope();
|
| + if (closure_scope->is_script_scope() ||
|
| + closure_scope->is_module_scope()) {
|
| // Contexts nested in the native context have a canonical empty function as
|
| // their closure, not the anonymous closure containing the global code.
|
| // Pass a SMI sentinel and let the runtime look up the empty function.
|
| return jsgraph()->SmiConstant(0);
|
| } else {
|
| - DCHECK(declaration_scope->is_function_scope());
|
| + DCHECK(closure_scope->is_function_scope());
|
| return GetFunctionClosure();
|
| }
|
| }
|
|
|