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-501.js
blob7de38b5055d85cb16a904017067aa67c3e5df5ce
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-501
6 description: >
7     ES5 Attributes - success to update [[Configurable]] attribute of
8     accessor property ([[Get]] is a Function, [[Set]] is undefined,
9     [[Enumerable]] is true, [[Configurable]] is true) to different
10     value
11 includes: [propertyHelper.js]
12 ---*/
14 var obj = {};
16 var getFunc = function() {
17   return 1001;
20 Object.defineProperty(obj, "prop", {
21   get: getFunc,
22   set: undefined,
23   enumerable: true,
24   configurable: true
25 });
26 var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
28 Object.defineProperty(obj, "prop", {
29   configurable: false
30 });
32 var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
34 assert.sameValue(desc1.configurable, true);
35 assert.sameValue(desc2.configurable, false);
37 verifyNotWritable(obj, "prop");
38 verifyNotConfigurable(obj, "prop");
40 assert(obj.hasOwnProperty("prop"));
42 reportCompare(0, 0);