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
This commit is contained in:
verwaest@chromium.org 2013-01-23 17:27:25 +00:00
parent bed569b548
commit 56adca9cc9

View File

@ -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);
}