Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index d45a9cdaeea3ab3725152056bb3a87ecde43e77d..b66711fb7693fa82cd8dd33c01e67380092dee90 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -1207,10 +1207,16 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(Variable* var, |
} else if (var->mode() == Variable::DYNAMIC_LOCAL) { |
Variable* local = var->local_if_not_shadowed(); |
__ mov(eax, ContextSlotOperandCheckExtensions(local, slow)); |
- if (local->mode() == Variable::CONST) { |
+ if (local->mode() == Variable::CONST || |
+ local->mode() == Variable::LET) { |
__ cmp(eax, isolate()->factory()->the_hole_value()); |
__ j(not_equal, done); |
- __ mov(eax, isolate()->factory()->undefined_value()); |
+ if (local->mode() == Variable::CONST) { |
+ __ mov(eax, isolate()->factory()->undefined_value()); |
+ } else { // Variable::LET |
+ __ push(Immediate(var->name())); |
+ __ CallRuntime(Runtime::kThrowReferenceError, 1); |
+ } |
} |
__ jmp(done); |
} |