15.2.3.6-4-194.js (980B)
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-194 6 description: > 7 Object.defineProperty - 'O' is an Array, 'name' is an array index 8 named property, 'name' is own accessor property, test TypeError is 9 thrown on updating the configurable attribute from false to true 10 (15.4.5.1 step 4.c) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var arrObj = []; 15 var getFunc = function() { 16 return 11; 17 }; 18 19 Object.defineProperty(arrObj, "0", { 20 get: getFunc, 21 configurable: false 22 }); 23 24 try { 25 Object.defineProperty(arrObj, "0", { 26 configurable: true 27 }); 28 throw new Test262Error("Expected an exception."); 29 } catch (e) { 30 verifyEqualTo(arrObj, "0", getFunc()); 31 32 if (!(e instanceof TypeError)) { 33 throw new Test262Error("Expected TypeError, got " + e.name); 34 } 35 } 36 37 verifyProperty(arrObj, "0", { 38 enumerable: false, 39 configurable: false, 40 }); 41 42 reportCompare(0, 0);