15.2.3.6-4-219.js (882B)
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.6-4-219 6 description: > 7 Object.defineProperty - 'O' is an Array, 'name' is an array index 8 property, test TypeError is thrown when the [[Value]] field of 9 'desc' is -0, and the [[Value]] attribute value of 'name' is +0 10 (15.4.5.1 step 4.c) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var arrObj = []; 15 16 Object.defineProperty(arrObj, "0", { 17 value: +0 18 }); 19 20 try { 21 Object.defineProperty(arrObj, "0", { 22 value: -0 23 }); 24 throw new Test262Error("Expected an exception."); 25 } catch (e) { 26 if (!(e instanceof TypeError)) { 27 throw new Test262Error("Expected TypeError, got " + e); 28 } 29 } 30 31 verifyProperty(arrObj, "0", { 32 value: +0, 33 writable: false, 34 enumerable: false, 35 configurable: false, 36 }); 37 38 reportCompare(0, 0);