15.2.3.6-4-213.js (1049B)
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-213 6 description: > 7 Object.defineProperty - 'O' is an Array, 'name' is an array index 8 named property, 'name' makes no change if the value of every field 9 in 'desc' is the same value as the corresponding field in 10 'name'(desc is accessor property) (15.4.5.1 step 4.c) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var arrObj = []; 15 var getFunc = function() { 16 return "100"; 17 }; 18 var setFunc = function(value) { 19 arrObj.setVerifyHelpProp = value; 20 }; 21 22 var desc = { 23 get: getFunc, 24 set: setFunc, 25 enumerable: true, 26 configurable: true 27 }; 28 29 Object.defineProperty(arrObj, "0", { 30 get: getFunc, 31 set: setFunc, 32 enumerable: true, 33 configurable: true 34 }); 35 36 Object.defineProperty(arrObj, "0", desc); 37 38 verifyEqualTo(arrObj, "0", getFunc()); 39 40 verifyWritable(arrObj, "0", "setVerifyHelpProp"); 41 42 verifyProperty(arrObj, "0", { 43 enumerable: true, 44 configurable: true, 45 }); 46 47 reportCompare(0, 0);