Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-230.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-230
6 description: >
7 Object.defineProperty - 'O' is an Array, 'name' is an array index
8 property, the [[Get]] field of 'desc' and the [[Get]] attribute
9 value of 'name' are two objects which refer to the same object
10 (15.4.5.1 step 4.c)
11 includes: [propertyHelper.js]
12 ---*/
13
14 var arrObj = [];
15 arrObj.helpVerifySet = 10;
16
17 function getFunc() {
18 return arrObj.helpVerifySet;
19 }
20
21 function setFunc(value) {
22 arrObj.helpVerifySet = value;
23 }
24
25 Object.defineProperty(arrObj, "0", {
26 get: getFunc,
27 set: setFunc
28 });
29
30 Object.defineProperty(arrObj, "0", {
31 get: getFunc
32 });
33 verifyEqualTo(arrObj, "0", getFunc());
34
35 verifyWritable(arrObj, "0", "helpVerifySet");
36
37 verifyNotEnumerable(arrObj, "0");
38
39 verifyNotConfigurable(arrObj, "0");