Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-447.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es5id: 15.2.3.6-4-447
6 description: >
7 ES5 Attributes - success to update [[Configurable]] attribute of
8 accessor property ([[Get]] is undefined, [[Set]] is undefined,
9 [[Enumerable]] is false, [[Configurable]] is true) to different
10 value
11 includes: [propertyHelper.js]
12 ---*/
13
14 var obj = {};
15
16 Object.defineProperty(obj, "prop", {
17 get: undefined,
18 set: undefined,
19 enumerable: false,
20 configurable: true
21 });
22 var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
23
24 Object.defineProperty(obj, "prop", {
25 configurable: false
26 });
27
28 var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
29
30 assert.sameValue(desc1.configurable, true);
31 assert.sameValue(desc2.configurable, false);
32
33 verifyNotConfigurable(obj, "prop");
34 assert(obj.hasOwnProperty("prop"));