Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-13.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-13
6 description: >
7 Object.defineProperties - 'O' is an Array object which implements
8 its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 )
9 includes: [propertyHelper.js]
10 ---*/
11
12 var arr = [];
13
14 Object.defineProperty(arr, "prop", {
15 value: 11,
16 configurable: false
17 });
18
19 try {
20 Object.defineProperties(arr, {
21 prop: {
22 value: 12,
23 configurable: true
24 }
25 });
26 $ERROR("Expected an exception.");
27 } catch (e) {
28 verifyEqualTo(arr, "prop", 11);
29
30 verifyNotWritable(arr, "prop");
31
32 verifyNotEnumerable(arr, "prop");
33
34 verifyNotConfigurable(arr, "prop");
35
36 if (!(e instanceof TypeError)) {
37 $ERROR("Expected TypeError, got " + e);
38 }
39
40 }