Commit 56adca9c authored by verwaest@chromium.org's avatar verwaest@chromium.org

Ensure a type-error is thrown when trying to assign to a readonly property on the global scope.

Review URL: https://chromiumcodereview.appspot.com/11953056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bed569b5
......@@ -1463,7 +1463,9 @@ MaybeObject* StoreIC::Store(State state,
if (FLAG_use_ic) {
UpdateStoreCaches(&lookup, state, strict_mode, receiver, name, value);
}
} else if (strict_mode == kStrictMode && IsUndeclaredGlobal(object)) {
} else if (strict_mode == kStrictMode &&
!(lookup.IsProperty() && lookup.IsReadOnly()) &&
IsUndeclaredGlobal(object)) {
// Strict mode doesn't allow setting non-existent global property.
return ReferenceError("not_defined", name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment