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