15.2.3.7-6-a-221.js (752B)
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-221 6 description: > 7 Object.defineProperties - 'O' is an Array, 'P' is an array index 8 property, the [[Get]] field of 'desc' and the [[Get]] attribute 9 value of 'P' are two objects which refer to the same object 10 (15.4.5.1 step 4.c) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var arr = []; 15 16 function get_func() { 17 return 10; 18 } 19 20 Object.defineProperty(arr, "0", { 21 get: get_func 22 }); 23 24 Object.defineProperties(arr, { 25 "0": { 26 get: get_func 27 } 28 }); 29 verifyEqualTo(arr, "0", get_func()); 30 31 verifyProperty(arr, "0", { 32 enumerable: false, 33 configurable: false, 34 }); 35 36 reportCompare(0, 0);