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

Unified Diff: test/mjsunit/regress/readonly3.js

Issue 12810006: Change LookupForWrite to always do a full lookup and check the result. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 9 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
« no previous file with comments | « test/mjsunit/regress/readonly2.js ('k') | test/mjsunit/regress/readonly4.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/readonly3.js
diff --git a/test/mjsunit/regress/regress-2565.js b/test/mjsunit/regress/readonly3.js
similarity index 74%
copy from test/mjsunit/regress/regress-2565.js
copy to test/mjsunit/regress/readonly3.js
index a77806a62e2209d355fce393b98797f1d20f40f8..f81979d272217d768fa9c9c90a0b22ce34d1c15b 100644
--- a/test/mjsunit/regress/regress-2565.js
+++ b/test/mjsunit/regress/readonly3.js
@@ -25,8 +25,41 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Object.freeze(Object.prototype);
+this.x = 0;
+
var p = {};
-var o = Object.create(p);
-assertSame(p, o.__proto__);
-assertSame(p, Object.getPrototypeOf(o));
+Object.defineProperty(p, "x", {writable:false, value:5});
+this.__proto__ = p;
+
+function s(v) {
+ v.x = 1;
+}
+
+function s_strict(v) {
+ "use strict";
+ v.x = 1;
+}
+
+function c(p) {
+ return {__proto__: p};
+}
+
+var o1 = c(this);
+var o2 = c(this);
+
+// Initialize the store IC.
+s(c(this));
+s(c(this));
+s_strict(c(this));
+s_strict(c(this));
+
+delete this.x;
+
+// Verify that direct setting fails.
+o1.x = 20;
+assertEquals(5, o1.x);
+
+// Verify that setting through the IC fails.
+s(o2);
+assertEquals(5, o2.x);
+assertThrows("s_strict(o2);", TypeError);
« no previous file with comments | « test/mjsunit/regress/readonly2.js ('k') | test/mjsunit/regress/readonly4.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698