Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index a1d70767881c1e77f6cf71108570d2f3e5640473..c7ff3a392b27748ddf4ae9231f24ff76ea33fed0 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -7820,8 +7820,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreContextSlot) { |
// The property exists in the extension context. |
context_ext = Handle<JSObject>::cast(holder); |
} else { |
- // The property was not found. It needs to be stored in the global context. |
+ // The property was not found. |
ASSERT(attributes == ABSENT); |
+ |
Martin Maly
2011/04/07 10:07:07
Fourth fix. If eval is in scope, runtime call is u
|
+ if (strict_mode == kStrictMode) { |
+ // Throw in strict mode (assignment to undefined variable). |
+ Handle<Object> error = |
+ isolate->factory()->NewReferenceError( |
+ "not_defined", HandleVector(&name, 1)); |
+ return isolate->Throw(*error); |
+ } |
+ // In non-strict mode, the property is stored in the global context. |
attributes = NONE; |
context_ext = Handle<JSObject>(isolate->context()->global()); |
} |