Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 7844d217830d7c3e6492cd84203802cb8124baf3..84d8f8149330ceaf7814eafaad0e3502b99f6c2d 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -2042,8 +2042,14 @@ void BytecodeGenerator::BuildVariableAssignment(Variable* variable, |
builder() |
->StoreAccumulatorInRegister(args[1]) |
.LoadLiteral(it->second->export_name->string()) |
- .StoreAccumulatorInRegister(args[0]) |
- .CallRuntime(Runtime::kStoreModuleExport, args); |
+ .StoreAccumulatorInRegister(args[0]); |
+ if (needs_hole_check) { |
+ builder()->CallRuntime(Runtime::kLoadModuleExport, args[0]); |
+ BuildHoleCheckForVariableAssignment(variable, op); |
+ } |
+ builder() |
+ ->CallRuntime(Runtime::kStoreModuleExport, args) |
+ .LoadAccumulatorWithRegister(args[1]); |
break; |
} |
} |