15.2.3.6-4-298-1.js (1368B)
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-298-1 6 description: > 7 Object.defineProperty - 'O' is an Arguments object of a function 8 that has formal parameters, 'name' is own accessor property of 'O' 9 which is also defined in [[ParameterMap]] of 'O', test TypeError 10 is thrown when updating the [[Set]] attribute value of 'name' 11 which is defined as non-configurable (10.6 [[DefineOwnProperty]] 12 steps 4 and 5a) 13 includes: [propertyHelper.js] 14 ---*/ 15 16 (function(a, b, c) { 17 function getFunc() { 18 return 10; 19 } 20 Object.defineProperty(arguments, "0", { 21 get: getFunc, 22 set: undefined, 23 enumerable: false, 24 configurable: false 25 }); 26 27 function setFunc(value) { 28 this.setVerifyHelpProp = value; 29 } 30 try { 31 Object.defineProperty(arguments, "0", { 32 set: setFunc 33 }); 34 throw new Test262Error("Expected an exception."); 35 } catch (e) { 36 if (a !== 0) { 37 throw new Test262Error('Expected a === 0, actually ' + a); 38 } 39 40 verifyEqualTo(arguments, "0", getFunc()); 41 42 if (!(e instanceof TypeError)) { 43 throw new Test262Error("Expected TypeError, got " + e); 44 } 45 } 46 47 verifyProperty(arguments, "0", { 48 enumerable: false, 49 configurable: false, 50 }); 51 }(0, 1, 2)); 52 53 reportCompare(0, 0);