Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-112.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-112
6 description: >
7 Object.defineProperties - 'O' is an Array, test the length
8 property of 'O' is own data property (15.4.5.1 step 1)
9 ---*/
10
11 var arr = [0, 1];
12 Object.defineProperty(arr, "1", {
13 value: 1,
14 configurable: false
15 });
16 assert.throws(TypeError, function() {
17 Object.defineProperties(arr, {
18 length: {
19 value: 1
20 }
21 });
22 });
23 var desc = Object.getOwnPropertyDescriptor(arr, "length");
24
25 assert.sameValue(desc.value, 2, 'desc.value');
26 assert(desc.writable, 'desc.writable !== true');
27 assert.sameValue(desc.enumerable, false, 'desc.enumerable');
28 assert.sameValue(desc.configurable, false, 'desc.configurable');