15.2.3.6-4-98.js (868B)
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-98 6 description: > 7 Object.defineProperty will not throw TypeError when 8 name.configurable = false, both desc.[[Get]] and name.[[Get]] are 9 two objects which refer to the same object (8.12.9 step 11.a.ii) 10 includes: [propertyHelper.js] 11 ---*/ 12 13 14 var obj = {}; 15 16 function getFunc() { 17 return 10; 18 } 19 20 function setFunc(value) { 21 obj.verifyGetHelpMethod = value; 22 } 23 24 Object.defineProperty(obj, "foo", { 25 get: getFunc, 26 set: setFunc, 27 configurable: false 28 }); 29 30 Object.defineProperty(obj, "foo", { 31 get: getFunc 32 }); 33 34 verifyEqualTo(obj, "foo", getFunc()); 35 36 verifyWritable(obj, "foo", "verifyGetHelpMethod"); 37 38 verifyProperty(obj, "foo", { 39 enumerable: false, 40 configurable: false, 41 }); 42 43 reportCompare(0, 0);