15.2.3.6-4-231.js (992B)
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-231 6 description: > 7 Object.defineProperty - 'O' is an Array, 'name' is an array index 8 property, the [[Get]] field of 'desc' and the [[Get]] attribute 9 value of 'name' are two objects which refer to the different 10 objects (15.4.5.1 step 4.c) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var arrObj = []; 15 arrObj.helpVerifySet = 10; 16 17 function getFunc1() { 18 return 20; 19 } 20 21 function getFunc2() { 22 return arrObj.helpVerifySet; 23 } 24 25 function setFunc(value) { 26 arrObj.helpVerifySet = value; 27 } 28 29 Object.defineProperty(arrObj, "0", { 30 get: getFunc1, 31 set: setFunc, 32 configurable: true 33 }); 34 35 Object.defineProperty(arrObj, "0", { 36 get: getFunc2 37 }); 38 39 verifyEqualTo(arrObj, "0", getFunc2()); 40 41 verifyWritable(arrObj, "0", "helpVerifySet"); 42 43 verifyProperty(arrObj, "0", { 44 enumerable: false, 45 configurable: true, 46 }); 47 48 reportCompare(0, 0);