Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-243.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-243
6 description: >
7 Object.defineProperty - 'O' is an Array, 'name' is an array index
8 named property, 'name' is accessor property and 'desc' is data
9 descriptor, and the [[Configurable]] attribute value of 'name' is
10 true, test 'name' is converted from accessor property to data
11 property (15.4.5.1 step 4.c)
12 includes: [propertyHelper.js]
13 ---*/
14
15
16 var arrObj = [];
17
18 function getFunc() {
19 return 3;
20 }
21 Object.defineProperty(arrObj, "1", {
22 get: getFunc,
23 configurable: true
24 });
25
26 Object.defineProperty(arrObj, "1", {
27 value: 12
28 });
29
30 verifyEqualTo(arrObj, "1", 12);
31
32 verifyNotWritable(arrObj, "1");
33
34 verifyNotEnumerable(arrObj, "1");
35
36 verifyConfigurable(arrObj, "1");