Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index 5e8e0e060e633154b3faf7ffc9a0ac15fc57e0af..49b33776cea839863b381ae3b4dbc5c485138c29 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -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); |
} |