2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
5 * Jeff Walden <jwalden+code@mit.edu>
8 var gTestfile = '15.2.3.4-01.js';
9 //-----------------------------------------------------------------------------
10 var BUGNUMBER = 492849;
11 var summary = 'ES5: Implement Object.preventExtensions, Object.isExtensible';
13 print(BUGNUMBER + ": " + summary);
19 assertEq(typeof Object.isExtensible, "function");
20 assertEq(Object.isExtensible.length, 1);
22 var slowArray = [1, 2, 3];
25 [{}, { 1: 2 }, { a: 3 }, [], [1], [, 1], slowArray, function a(){}, /a/];
27 for (var i = 0, sz = objs.length; i < sz; i++)
30 assertEq(Object.isExtensible(o), true, "object " + i + " not extensible?");
32 var o2 = Object.preventExtensions(o);
35 assertEq(Object.isExtensible(o), false, "object " + i + " is extensible?");
38 /******************************************************************************/
40 reportCompare(true, true);
42 print("All tests passed!");