Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 1d6532c8eb5127ba1126bee3fb4e4673bf532b62..c8b0eedbe204c9b748736512ed825cd3a7852103 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -1783,10 +1783,13 @@ void BytecodeGenerator::VisitDelete(UnaryOperation* expr) { |
case VariableLocation::GLOBAL: |
case VariableLocation::UNALLOCATED: { |
// Global var, let, const or variables not explicitly declared. |
+ Register native_context = execution_result()->NewRegister(); |
Register global_object = execution_result()->NewRegister(); |
builder() |
->LoadContextSlot(execution_context()->reg(), |
- Context::GLOBAL_OBJECT_INDEX) |
+ Context::NATIVE_CONTEXT_INDEX) |
+ .StoreAccumulatorInRegister(native_context) |
+ .LoadContextSlot(native_context, Context::EXTENSION_INDEX) |
.StoreAccumulatorInRegister(global_object) |
.LoadLiteral(variable->name()) |
.Delete(global_object, language_mode()); |