| Index: src/x64/full-codegen-x64.cc
 | 
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
 | 
| index 25bfd340294e2f7aa9a84a6b336748ad9e4f4f35..5b8a4a3220ff2e8b0195d1a03ef64b6955a3663e 100644
 | 
| --- a/src/x64/full-codegen-x64.cc
 | 
| +++ b/src/x64/full-codegen-x64.cc
 | 
| @@ -187,10 +187,10 @@ void FullCodeGenerator::Generate() {
 | 
|      Comment cmnt(masm_, "[ Allocate context");
 | 
|      bool need_write_barrier = true;
 | 
|      // Argument to NewContext is the function, which is still in rdi.
 | 
| -    if (FLAG_harmony_scoping && info->scope()->is_global_scope()) {
 | 
| +    if (FLAG_harmony_scoping && info->scope()->is_script_scope()) {
 | 
|        __ Push(rdi);
 | 
|        __ Push(info->scope()->GetScopeInfo());
 | 
| -      __ CallRuntime(Runtime::kNewGlobalContext, 2);
 | 
| +      __ CallRuntime(Runtime::kNewScriptContext, 2);
 | 
|      } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
 | 
|        FastNewContextStub stub(isolate(), heap_slots);
 | 
|        __ CallStub(&stub);
 | 
| @@ -895,7 +895,7 @@ void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
 | 
|    EmitDebugCheckDeclarationContext(variable);
 | 
|  
 | 
|    // Load instance object.
 | 
| -  __ LoadContext(rax, scope_->ContextChainLength(scope_->GlobalScope()));
 | 
| +  __ LoadContext(rax, scope_->ContextChainLength(scope_->ScriptScope()));
 | 
|    __ movp(rax, ContextOperand(rax, variable->interface()->Index()));
 | 
|    __ movp(rax, ContextOperand(rax, Context::EXTENSION_INDEX));
 | 
|  
 | 
| @@ -5043,7 +5043,7 @@ void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
 | 
|  
 | 
|  void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
 | 
|    Scope* declaration_scope = scope()->DeclarationScope();
 | 
| -  if (declaration_scope->is_global_scope() ||
 | 
| +  if (declaration_scope->is_script_scope() ||
 | 
|        declaration_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
 | 
| 
 |