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

Unified Diff: test/mjsunit/object-freeze.js

Issue 233083003: Try to switch Array builtins into strict mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
Index: test/mjsunit/object-freeze.js
diff --git a/test/mjsunit/object-freeze.js b/test/mjsunit/object-freeze.js
index 3b7987402f8c91f466bcdd997f153873210f195a..4144936d06437396b5625f5a51493c45db42732d 100644
--- a/test/mjsunit/object-freeze.js
+++ b/test/mjsunit/object-freeze.js
@@ -322,13 +322,15 @@ Object.freeze(obj);
// sufficient.
assertTrue(Object.isSealed(obj));
-assertDoesNotThrow(function() { obj.push(); });
-assertDoesNotThrow(function() { obj.unshift(); });
-assertDoesNotThrow(function() { obj.splice(0,0); });
+// Verify that the length can't be written by builtins.
+assertThrows(function() { obj.push(); }, TypeError);
+assertThrows(function() { obj.unshift(); }, TypeError);
+assertThrows(function() { obj.splice(0,0); }, TypeError);
assertTrue(Object.isFrozen(obj));
// Verify that an item can't be changed with splice.
assertThrows(function() { obj.splice(0,1,1); }, TypeError);
+assertTrue(Object.isFrozen(obj));
// Verify that unshift() with no arguments will fail if it reifies from
// the prototype into the object.

Powered by Google App Engine
This is Rietveld 408576698