15.2.3.7-6-a-19.js (861B)
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-19 6 description: > 7 Object.defineProperties - 'O' is a RegExp object which implements 8 its own [[GetOwnProperty]] method to get 'P' (8.12.9 step 1 ) 9 includes: [propertyHelper.js] 10 ---*/ 11 12 13 var obj = new RegExp(); 14 15 Object.defineProperty(obj, "prop", { 16 value: 11, 17 configurable: false 18 }); 19 20 try { 21 Object.defineProperties(obj, { 22 prop: { 23 value: 12, 24 configurable: true 25 } 26 }); 27 throw new Test262Error("Expected an exception."); 28 } catch (e) { 29 if (!(e instanceof TypeError)) { 30 throw new Test262Error("Expected TypeError, got " + e); 31 } 32 } 33 34 verifyProperty(obj, "prop", { 35 value: 11, 36 writable: false, 37 enumerable: false, 38 configurable: false, 39 }); 40 41 reportCompare(0, 0);