15.2.3.7-6-a-275.js (960B)
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-275 6 description: > 7 Object.defineProperties - 'O' is an Array, 'P' is generic own 8 accessor property of 'O', test TypeError is thrown when updating 9 the [[Set]] 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 function set_fun(value) { 18 arr.setVerifyHelpProp = value; 19 } 20 Object.defineProperty(arr, "property", { 21 set: set_fun 22 }); 23 24 try { 25 Object.defineProperties(arr, { 26 "property": { 27 set: function() {} 28 } 29 }); 30 } catch (e) { 31 verifyWritable(arr, "property", "setVerifyHelpProp"); 32 33 if (!(e instanceof TypeError)) { 34 throw new Test262Error("Expected TypeError, got " + e); 35 } 36 } 37 38 verifyProperty(arr, "property", { 39 enumerable: false, 40 configurable: false, 41 }); 42 43 reportCompare(0, 0);