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

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

Issue 6712059: Follow jsc on not throwing when trying to add a property to a non-extensible object. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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
Index: test/mjsunit/object-freeze.js
===================================================================
--- test/mjsunit/object-freeze.js (revision 7276)
+++ test/mjsunit/object-freeze.js (working copy)
@@ -70,12 +70,8 @@
assertFalse(Object.isExtensible(obj));
assertTrue(Object.isFrozen(obj));
-try {
- obj.foo = 42;
- assertUnreachable();
-} catch(e) {
- assertTrue(/object is not extensible/.test(e));
-}
+obj.foo = 42;
+assertEquals(obj.foo, undefined);
desc = Object.getOwnPropertyDescriptor(obj, 'x');
assertFalse(desc.writable);
@@ -88,7 +84,7 @@
assertEquals("foobar", desc.value);
// Make sure that even if we try overwrite a value that is not writable, it is
-// not changed.
+// not changed.
obj.x = "tete";
assertEquals(42, obj.x);
obj.x = { get: function() {return 43}, set: function() {} };
@@ -118,12 +114,8 @@
assertEquals(set, desc.set);
assertEquals(get, desc.get);
-try {
- obj2.foo = 42;
- assertUnreachable();
-} catch(e) {
- assertTrue(/object is not extensible/.test(e));
-}
+obj2.foo = 42;
+assertEquals(obj2.foo, undefined);
// Test freeze on arrays.

Powered by Google App Engine
This is Rietveld 408576698