blob: e22b9a9ead6fde5761d5230cd4852e556b9834d7 [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright (c) 2012 Ecma International. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3
4/*---
5es5id: 15.2.3.7-6-a-112
6description: >
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 });
16assert.throws(TypeError, function() {
17 Object.defineProperties(arr, {
18 length: { value: 1 }
19 });
20});
21 var desc = Object.getOwnPropertyDescriptor(arr, "length");
22
23assert.sameValue(desc.value, 2, 'desc.value');
24assert(desc.writable, 'desc.writable !== true');
25assert.sameValue(desc.enumerable, false, 'desc.enumerable');
26assert.sameValue(desc.configurable, false, 'desc.configurable');