15.2.3.7-5-b-236.js (784B)
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-5-b-236 6 description: > 7 Object.defineProperties - 'set' property of 'descObj' is own 8 accessor property without a get function (8.10.5 step 8.a) 9 ---*/ 10 11 var fun = function() { 12 return 10; 13 }; 14 var descObj = { 15 get: fun 16 }; 17 Object.defineProperty(descObj, "set", { 18 set: function() {} 19 }); 20 21 var obj = {}; 22 23 Object.defineProperties(obj, { 24 prop: descObj 25 }); 26 27 var desc = Object.getOwnPropertyDescriptor(obj, "prop"); 28 29 assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); 30 assert.sameValue(typeof desc.set, "undefined", 'typeof desc.set'); 31 assert.sameValue(obj.prop, 10, 'obj.prop'); 32 33 reportCompare(0, 0);