| 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-209 |
| 6 |
description: > |
| 7 |
Object.defineProperty - 'O' is an Array, 'name' is an array index |
| 8 |
named property, 'desc' is accessor descriptor, test updating all |
| 9 |
attribute values of 'name' (15.4.5.1 step 4.c) |
| 10 |
includes: [propertyHelper.js] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var arrObj = []; |
| 14 |
var setFunc = function(value) { |
| 15 |
arrObj.setVerifyHelpProp = value; |
| 16 |
}; |
| 17 |
var getFunc = function() { |
| 18 |
return 14; |
| 19 |
}; |
| 20 |
|
| 21 |
Object.defineProperty(arrObj, "0", { |
| 22 |
get: function() { |
| 23 |
return 11; |
| 24 |
}, |
| 25 |
set: function() {}, |
| 26 |
configurable: true, |
| 27 |
enumerable: true |
| 28 |
}); |
| 29 |
|
| 30 |
Object.defineProperty(arrObj, "0", { |
| 31 |
get: getFunc, |
| 32 |
set: setFunc, |
| 33 |
configurable: false, |
| 34 |
enumerable: false |
| 35 |
}); |
| 36 |
|
| 37 |
verifyEqualTo(arrObj, "0", getFunc()); |
| 38 |
|
| 39 |
verifyWritable(arrObj, "0", "setVerifyHelpProp"); |
| 40 |
|
| 41 |
verifyNotEnumerable(arrObj, "0"); |
| 42 |
|
| 43 |
verifyNotConfigurable(arrObj, "0"); |