15.2.3.7-6-a-93-3.js (1194B)
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-93-3 6 description: > 7 Object.defineProperties will fail to update [[Value]] attribute of 8 named data property 'P' when [[Configurable]] attribute of first 9 updating property is false (8.12.9 - step Note & 10.a.ii.1) 10 includes: [propertyHelper.js] 11 ---*/ 12 13 14 var obj = {}; 15 16 Object.defineProperty(obj, "property", { 17 value: 1001, 18 writable: false, 19 configurable: false 20 }); 21 22 Object.defineProperty(obj, "property1", { 23 value: 1003, 24 writable: false, 25 configurable: true 26 }); 27 28 try { 29 Object.defineProperties(obj, { 30 property: { 31 value: 1002 32 }, 33 property1: { 34 value: 1004 35 } 36 }); 37 38 throw new Test262Error("Expected an exception."); 39 } catch (e) { 40 if (!(e instanceof TypeError)) { 41 throw new Test262Error("Expected TypeError, got " + e); 42 } 43 } 44 45 verifyProperty(obj, "property", { 46 value: 1001, 47 writable: false, 48 enumerable: false, 49 configurable: false, 50 }); 51 52 verifyProperty(obj, "property1", { 53 value: 1003, 54 writable: false, 55 enumerable: false, 56 configurable: true, 57 }); 58 59 reportCompare(0, 0);