15.2.3.6-4-510.js (966B)
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-510 6 description: > 7 ES5 Attributes - fail to update [[Configurable]] attribute of 8 accessor property ([[Get]] is a Function, [[Set]] is undefined, 9 [[Enumerable]] is true, [[Configurable]] is false) to different 10 value 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var obj = {}; 15 16 var getFunc = function() { 17 return 1001; 18 }; 19 20 Object.defineProperty(obj, "prop", { 21 get: getFunc, 22 set: undefined, 23 enumerable: true, 24 configurable: false 25 }); 26 var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); 27 28 try { 29 Object.defineProperty(obj, "prop", { 30 configurable: true 31 }); 32 33 throw new Test262Error("Expected TypeError"); 34 } catch (e) { 35 assert(e instanceof TypeError); 36 37 assert.sameValue(desc1.configurable, false); 38 } 39 40 verifyProperty(obj, "prop", { 41 configurable: false, 42 }); 43 44 reportCompare(0, 0);