15.2.3.6-4-91.js (899B)
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-91 6 description: > 7 Object.defineProperty will throw TypeError when name.configurable 8 = false, name.writable = false, desc.value and name.value are two 9 strings with different values (8.12.9 step 10.a.ii.1) 10 includes: [propertyHelper.js] 11 ---*/ 12 13 14 var obj = {}; 15 16 Object.defineProperty(obj, "foo", { 17 value: "abcd", 18 writable: false, 19 configurable: false 20 }); 21 22 try { 23 Object.defineProperty(obj, "foo", { 24 value: "fghj" 25 }); 26 throw new Test262Error("Expected an exception."); 27 } catch (e) { 28 if (!(e instanceof TypeError)) { 29 throw new Test262Error("Expected TypeError, got " + e); 30 } 31 } 32 33 verifyProperty(obj, "foo", { 34 value: "abcd", 35 writable: false, 36 enumerable: false, 37 configurable: false, 38 }); 39 40 reportCompare(0, 0);