15.2.3.7-5-b-238.js (871B)
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-238 6 description: > 7 Object.defineProperties - 'set' property of 'descObj' is inherited 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 proto = {}; 15 Object.defineProperty(proto, "set", { 16 set: function() {} 17 }); 18 19 var Con = function() {}; 20 Con.prototype = proto; 21 22 var descObj = new Con(); 23 descObj.get = fun; 24 25 var obj = {}; 26 27 Object.defineProperties(obj, { 28 prop: descObj 29 }); 30 31 var desc = Object.getOwnPropertyDescriptor(obj, "prop"); 32 33 assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); 34 assert.sameValue(typeof(desc.set), "undefined", 'typeof (desc.set)'); 35 assert.sameValue(obj.prop, 10, 'obj.prop'); 36 37 reportCompare(0, 0);