Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-229.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-229
6 description: >
7 Object.defineProperties - 'O' is an Array, 'P' is an array index
8 property, TypeError is thrown if 'P' is accessor property, and
9 'desc' is data descriptor, and the [[Configurable]] attribute
10 value of 'P' is false (15.4.5.1 step 4.c)
11 includes: [propertyHelper.js]
12 ---*/
13
14
15 var arr = [];
16
17 function set_fun(value) {
18 arr.setVerifyHelpProp = value;
19 }
20
21 Object.defineProperty(arr, "1", {
22 set: set_fun,
23 configurable: false
24
25 });
26
27 try {
28 Object.defineProperties(arr, {
29 "1": {
30 value: 13
31 }
32 });
33 $ERROR("Expected an exception.");
34
35 } catch (e) {
36 verifyWritable(arr, "1", "setVerifyHelpProp");
37
38 verifyNotEnumerable(arr, "1");
39
40 verifyNotConfigurable(arr, "1");
41
42 if (!(e instanceof TypeError)) {
43 $ERROR("Expected TypeError, got " + e);
44 }
45
46 }