blob: c0b16d890f6cb416d9743330111bb3792f41a866 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
* Contributor:
* Jeff Walden <jwalden+code@mit.edu>
*/
var gTestfile = 'preventExtensions-idempotent.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 599459;
var summary = 'Object.preventExtensions should be idempotent';
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var obj = {};
assertEq(Object.preventExtensions(obj), obj);
assertEq(Object.isExtensible(obj), false);
assertEq(Object.preventExtensions(obj), obj);
assertEq(Object.isExtensible(obj), false);
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("All tests passed!");
|