Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: src/runtime.cc

Issue 6814012: Strict mode fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}

Powered by Google App Engine
This is Rietveld 408576698