blob: 40756f8da9d7d52940056633ed41beeb29d0c6b0 [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-163
6description: >
7 Object.defineProperties - 'O' is an Array, 'P' is the length
8 property of 'O', the [[Value]] field of 'desc' is less than value
9 of the length property, test the [[Writable]] attribute of the
10 length property is set to false at last after deleting properties
11 with large index named if the [[Writable]] field of 'desc' is
12 false (15.4.5.1 step 3.i.ii)
13includes: [propertyHelper.js]
14---*/
15
16
17var arr = [0, 1];
18
19Object.defineProperties(arr, {
20 length: {
21 value: 1,
22 writable: false
23 }
24});
25
26//try to overwrite length value of arr
27verifyNotWritable(arr, "length")
28
29assert(!arr.hasOwnProperty("1"));
30assert.sameValue(arr.length, 1);
31assert.sameValue(arr[0], 0);