15.2.3.6-4-282.js (930B)
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-282 6 description: > 7 Object.defineProperty - 'O' is an Array, 'name' is generic own 8 data property of 'O', test TypeError is thrown when updating the 9 [[Writable]] attribute value of 'name' which is defined as 10 non-configurable (15.4.5.1 step 5) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 15 var arrObj = []; 16 17 Object.defineProperty(arrObj, "property", { 18 writable: false 19 }); 20 try { 21 Object.defineProperty(arrObj, "property", { 22 writable: true 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, "property", { 32 value: undefined, 33 writable: false, 34 enumerable: false, 35 configurable: false, 36 }); 37 38 reportCompare(0, 0);