15.2.3.7-6-a-242.js (1142B)
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-242 6 description: > 7 Object.defineProperties - TypeError is thrown if 'O' is an Array, 8 'P' is an array index named property that already exists on 'O' is 9 accessor property with [[Configurable]] false, 'desc' is accessor 10 descriptor, the [[Set]] field of 'desc' is present, and the 11 [[Set]] field of 'desc' is an object and the [[Set]] attribute 12 value of 'P' is undefined (15.4.5.1 step 4.c) 13 includes: [propertyHelper.js] 14 ---*/ 15 16 var arr = []; 17 18 function set_fun(value) { 19 arr.setVerifyHelpProp = value; 20 } 21 Object.defineProperty(arr, "1", { 22 set: set_fun 23 }); 24 25 try { 26 Object.defineProperties(arr, { 27 "1": { 28 set: undefined 29 } 30 }); 31 32 throw new Test262Error("Expected an exception."); 33 } catch (e) { 34 verifyWritable(arr, "1", "setVerifyHelpProp"); 35 36 if (!(e instanceof TypeError)) { 37 throw new Test262Error("Expected TypeError, got " + e); 38 } 39 } 40 41 verifyProperty(arr, "1", { 42 enumerable: false, 43 configurable: false, 44 }); 45 46 reportCompare(0, 0);