15.2.3.7-6-a-262.js (1010B)
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-262 6 description: > 7 Object.defineProperties - 'O' is an Array, 'P' is an array index 8 named property that already exists on 'O' is accessor property and 9 'desc' is accessor descriptor, test updating multiple attribute 10 values of 'P' (15.4.5.1 step 4.c) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 15 var arr = []; 16 17 function get_fun() { 18 return 36; 19 } 20 21 function set_fun(value) { 22 arr.setVerifyHelpProp = value; 23 } 24 Object.defineProperty(arr, "0", { 25 get: function() { 26 return 12; 27 }, 28 set: set_fun, 29 enumerable: true, 30 configurable: true 31 }); 32 33 Object.defineProperties(arr, { 34 "0": { 35 get: get_fun, 36 enumerable: false, 37 configurable: false 38 } 39 }); 40 verifyEqualTo(arr, "0", get_fun()); 41 42 verifyWritable(arr, "0", "setVerifyHelpProp"); 43 44 verifyProperty(arr, "0", { 45 enumerable: false, 46 configurable: false, 47 }); 48 49 reportCompare(0, 0);