Revision: 13485
Author:   [email protected]
Date:     Wed Jan 23 09:27:25 2013
Log: 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
http://code.google.com/p/v8/source/detail?r=13485

Modified:
 /branches/bleeding_edge/src/ic.cc

=======================================
--- /branches/bleeding_edge/src/ic.cc   Wed Jan 23 08:04:19 2013
+++ /branches/bleeding_edge/src/ic.cc   Wed Jan 23 09:27:25 2013
@@ -1463,7 +1463,9 @@
     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);
   }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to