| 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.6-4-189 |
| 6 |
description: > |
| 7 |
Object.defineProperty - 'O' is an Array, 'name' is an array index |
| 8 |
named property, test TypeError is thrown if the [[Writable]] |
| 9 |
attribute of the length property in 'O' is false and value of |
| 10 |
'name' is greater than value of the length property (15.4.5.1 step |
| 11 |
4.b) |
| 12 |
---*/ |
| 13 |
|
| 14 |
var arrObj = [1, 2, 3]; |
| 15 |
|
| 16 |
Object.defineProperty(arrObj, "length", { |
| 17 |
writable: false |
| 18 |
}); |
| 19 |
assert.throws(TypeError, function() { |
| 20 |
Object.defineProperty(arrObj, 4, { |
| 21 |
value: "abc" |
| 22 |
}); |
| 23 |
}); |