Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperty / 15.2.3.6-4-456.js
blobda9397f14d25675f3d6903ffcc0e24bc85426474
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.6-4-456
6 description: >
7     ES5 Attributes - fail to update [[Configurable]] attribute of
8     accessor property ([[Get]] is undefined, [[Set]] is undefined,
9     [[Enumerable]] is false, [[Configurable]] is false) to different
10     value
11 includes: [propertyHelper.js]
12 ---*/
14 var obj = {};
16 Object.defineProperty(obj, "prop", {
17   get: undefined,
18   set: undefined,
19   enumerable: false,
20   configurable: false
21 });
22 var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
24 try {
25   Object.defineProperty(obj, "prop", {
26     configurable: true
27   });
29   throw new Test262Error("Expected TypeError");
30 } catch (e) {
31   assert(e instanceof TypeError);
33   var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
35   assert.sameValue(desc1.configurable, false);
36   assert.sameValue(desc2.configurable, false);
38   verifyNotConfigurable(obj, "prop");
40   assert(obj.hasOwnProperty("prop"));
43 reportCompare(0, 0);