Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Object / freeze / 15.2.3.9-2-c-1.js
blob219519195c5f9b174a38d5af68eba29fd816c939
1 // Copyright (c) 2012 Ecma International.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 es5id: 15.2.3.9-2-c-1
6 description: >
7     Object.freeze - The [[Configurable]] attribute of own data
8     property of 'O' is set to false while other attributes are
9     unchanged
10 includes: [propertyHelper.js]
11 ---*/
13 var obj = {};
15 Object.defineProperty(obj, "foo", {
16   value: 10,
17   writable: false,
18   enumerable: true,
19   configurable: true
20 });
22 Object.freeze(obj);
24 var desc = Object.getOwnPropertyDescriptor(obj, "foo");
26 if (desc.configurable !== false) {
27   throw new Test262Error("Expected desc.configurable to be false, actually " + desc.configurable);
29 if (desc.writable !== false) {
30   throw new Test262Error("Expected desc.writable to be false, actually " + desc.writable);
33 verifyEqualTo(obj, "foo", 10);
35 verifyNotWritable(obj, "foo");
37 verifyEnumerable(obj, "foo");
39 verifyNotConfigurable(obj, "foo");
41 reportCompare(0, 0);