15.2.3.7-6-a-306.js (1059B)
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-306 6 description: > 7 Object.defineProperties - 'O' is an Arguments object, 'P' is 8 generic own data property of 'O', test TypeError is thrown when 9 updating the [[Value]] attribute value of 'P' which is not 10 writable and not configurable (10.6 [[DefineOwnProperty]] step 4) 11 includes: [propertyHelper.js] 12 ---*/ 13 14 var arg = (function() { 15 return arguments; 16 }(1, 2, 3)); 17 18 Object.defineProperty(arg, "genericProperty", { 19 value: 1001, 20 writable: false, 21 configurable: false 22 }); 23 24 try { 25 Object.defineProperties(arg, { 26 "genericProperty": { 27 value: 1002 28 } 29 }); 30 31 throw new Test262Error("Expected an exception."); 32 } catch (e) { 33 if (!(e instanceof TypeError)) { 34 throw new Test262Error("Expected TypeError, got " + e); 35 } 36 } 37 38 verifyProperty(arg, "genericProperty", { 39 value: 1001, 40 writable: false, 41 enumerable: false, 42 configurable: false, 43 }); 44 45 reportCompare(0, 0);