Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-470.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-470
6 description: >
7 ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a
8 Function, [[Enumerable]] is true, [[Configurable]] is false) is
9 undeletable
10 includes: [propertyHelper.js]
11 ---*/
12
13 var obj = {};
14
15 var verifySetFunc = "data";
16 var setFunc = function(value) {
17 verifySetFunc = value;
18 };
19
20 Object.defineProperty(obj, "prop", {
21 get: undefined,
22 set: setFunc,
23 enumerable: true,
24 configurable: false
25 });
26
27 assert(obj.hasOwnProperty("prop"));
28
29 var desc = Object.getOwnPropertyDescriptor(obj, "prop");
30
31 verifyNotWritable(obj, "prop");
32 verifyNotConfigurable(obj, "prop");
33
34 assert.sameValue(desc.configurable, false);
35
36 assert(obj.hasOwnProperty("prop"));