15.2.3.5-4-277.js (929B)
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.5-4-277 6 description: > 7 Object.create - 'set' property of one property in 'Properties' is 8 own accessor property without a get function, which overrides an 9 inherited accessor property (8.10.5 step 8.a) 10 ---*/ 11 12 var proto = {}; 13 Object.defineProperty(proto, "set", { 14 get: function() { 15 return function() {}; 16 } 17 }); 18 19 var ConstructFun = function() {}; 20 ConstructFun.prototype = proto; 21 var child = new ConstructFun(); 22 Object.defineProperty(child, "set", { 23 set: function() {} 24 }); 25 26 var newObj = Object.create({}, { 27 prop: child 28 }); 29 30 var desc = Object.getOwnPropertyDescriptor(newObj, "prop"); 31 32 assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); 33 assert.sameValue(typeof desc.set, "undefined", 'typeof desc.set'); 34 35 reportCompare(0, 0);