| 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-163 |
| 6 |
description: > |
| 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) |
| 13 |
includes: [propertyHelper.js] |
| 14 |
---*/ |
| 15 |
|
| 16 |
|
| 17 |
var arr = [0, 1]; |
| 18 |
|
| 19 |
Object.defineProperties(arr, { |
| 20 |
length: { |
| 21 |
value: 1, |
| 22 |
writable: false |
| 23 |
} |
| 24 |
}); |
| 25 |
|
| 26 |
//try to overwrite length value of arr |
| 27 |
verifyNotWritable(arr, "length") |
| 28 |
|
| 29 |
assert(!arr.hasOwnProperty("1")); |
| 30 |
assert.sameValue(arr.length, 1); |
| 31 |
assert.sameValue(arr[0], 0); |