15.2.3.7-6-a-164.js (946B)
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-164 6 description: > 7 Object.defineProperties - 'O' is an Array, 'P' is the length 8 property of 'O', the [[Value]] field of 'desc' is less than value 9 of the length property, test the [[Writable]] attribute of the 10 length property in 'O' is set as true before deleting properties 11 with large index named (15.4.5.1 step 3.i.iii) 12 includes: [propertyHelper.js] 13 ---*/ 14 15 16 var arr = [0, 1, 2]; 17 var result = 0; 18 19 try { 20 Object.defineProperty(arr, "1", { 21 configurable: false 22 }); 23 24 Object.defineProperties(arr, { 25 length: { 26 value: 0, 27 writable: false 28 } 29 }); 30 31 throw new Test262Error("expected to throw TypeError") 32 } catch (e) { 33 assert(e instanceof TypeError); 34 } 35 36 verifyProperty(arr, "length", { 37 value: 2, 38 writable: false, 39 }); 40 41 reportCompare(0, 0);