15.2.3.7-6-a-272.js (945B)
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-272 6 description: > 7 Object.defineProperties - 'O' is an Array, 'P' is generic own data 8 property of 'O', test TypeError is thrown when updating the 9 [[Enumerable]] attribute value of 'P' which is defined as 10 non-configurable (15.4.5.1 step 5) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 15 var arr = []; 16 17 Object.defineProperty(arr, "property", { 18 value: 12, 19 enumerable: false 20 }); 21 22 try { 23 Object.defineProperties(arr, { 24 "property": { 25 enumerable: true 26 } 27 }); 28 throw new Test262Error("Expected an exception."); 29 } catch (e) { 30 if (!(e instanceof TypeError)) { 31 throw new Test262Error("Expected TypeError, got " + e); 32 } 33 } 34 35 verifyProperty(arr, "property", { 36 value: 12, 37 writable: false, 38 enumerable: false, 39 configurable: false, 40 }); 41 42 reportCompare(0, 0);