Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-267.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.7-6-a-267
6 description: >
7 Object.defineProperties - 'O' is an Array, 'P' is generic
8 property, and 'desc' is accessor descriptor, test 'P' is defined
9 in 'O' with all correct attribute values (15.4.5.1 step 5)
10 includes: [propertyHelper.js]
11 ---*/
12
13
14 var arr = [];
15
16 function get_fun() {
17 return 12;
18 }
19
20 function set_fun(value) {
21 arr.setVerifyHelpProp = value;
22 }
23
24 Object.defineProperties(arr, {
25 "property": {
26 get: get_fun,
27 set: set_fun,
28 enumerable: true,
29 configurable: true
30 }
31 });
32 verifyEqualTo(arr, "property", get_fun());
33
34 verifyWritable(arr, "property", "setVerifyHelpProp");
35
36 verifyEnumerable(arr, "property");
37
38 verifyConfigurable(arr, "property");
39
40 if (arr.length !== 0) {
41 $ERROR('Expected arr.length === 0, actually ' + arr.length);
42 }