Revision: 5176
Author: [email protected]
Date: Thu Aug  5 03:56:15 2010
Log: Object.seal(obj) and Object.freeze(obj) should return the input obj.

BUG=http://code.google.com/p/v8/issues/detail?id=809
TEST=Seal/freeze an object and check if Object.seal and Object.freeze returns the given object.

Burcu Dogan <[email protected]>

Review URL: http://codereview.chromium.org/3056049

http://code.google.com/p/v8/source/detail?r=5176

Modified:
 /branches/bleeding_edge/AUTHORS
 /branches/bleeding_edge/src/v8natives.js
 /branches/bleeding_edge/test/mjsunit/object-freeze.js
 /branches/bleeding_edge/test/mjsunit/object-seal.js

=======================================
--- /branches/bleeding_edge/AUTHORS     Fri May  7 13:02:57 2010
+++ /branches/bleeding_edge/AUTHORS     Thu Aug  5 03:56:15 2010
@@ -28,4 +28,5 @@
 Rodolph Perfetta <[email protected]>
 Ryan Dahl <[email protected]>
 Subrato K De <[email protected]>
-
+Burcu Dogan <[email protected]>
+
=======================================
--- /branches/bleeding_edge/src/v8natives.js    Tue Jul 27 02:20:21 2010
+++ /branches/bleeding_edge/src/v8natives.js    Thu Aug  5 03:56:15 2010
@@ -749,7 +749,7 @@
     if (desc.isConfigurable()) desc.setConfigurable(false);
     DefineOwnProperty(obj, name, desc, true);
   }
-  ObjectPreventExtension(obj);
+  return ObjectPreventExtension(obj);
 }


@@ -766,7 +766,7 @@
     if (desc.isConfigurable()) desc.setConfigurable(false);
     DefineOwnProperty(obj, name, desc, true);
   }
-  ObjectPreventExtension(obj);
+  return ObjectPreventExtension(obj);
 }


=======================================
--- /branches/bleeding_edge/test/mjsunit/object-freeze.js Wed Jul 14 06:15:43 2010 +++ /branches/bleeding_edge/test/mjsunit/object-freeze.js Thu Aug 5 03:56:15 2010
@@ -191,3 +191,7 @@
 Object.preventExtensions(obj5);

 assertFalse(Object.isFrozen(obj5));
+
+// Make sure that Object.freeze returns the frozen object.
+var obj6 = {}
+assertTrue(obj6 === Object.freeze(obj6))
=======================================
--- /branches/bleeding_edge/test/mjsunit/object-seal.js Thu Jul 15 00:51:14 2010 +++ /branches/bleeding_edge/test/mjsunit/object-seal.js Thu Aug 5 03:56:15 2010
@@ -193,3 +193,7 @@
 Object.preventExtensions(obj4);

 assertFalse(Object.isSealed(obj4));
+
+// Make sure that Object.seal returns the sealed object.
+var obj4 = {}
+assertTrue(obj4 === Object.seal(obj4))

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

Reply via email to