15.2.3.6-3-210.js (850B)
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-3-210 6 description: > 7 Object.defineProperty - 'get' property in 'Attributes' is own data 8 property that overrides an inherited accessor property (8.10.5 9 step 7.a) 10 ---*/ 11 12 var obj = {}; 13 var proto = {}; 14 var fun = function() { 15 return "inheritedAccessorProperty"; 16 }; 17 Object.defineProperty(proto, "get", { 18 get: function() { 19 return fun; 20 } 21 }); 22 23 var ConstructFun = function() {}; 24 ConstructFun.prototype = proto; 25 26 var child = new ConstructFun(); 27 Object.defineProperty(child, "get", { 28 value: function() { 29 return "ownDataProperty"; 30 } 31 }); 32 33 Object.defineProperty(obj, "property", child); 34 35 assert.sameValue(obj.property, "ownDataProperty", 'obj.property'); 36 37 reportCompare(0, 0);