| 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-593 |
| 6 |
description: > |
| 7 |
ES5 Attributes - [[Get]] field of inherited property of |
| 8 |
[[Prototype]] internal property is correct |
| 9 |
(Function.prototype.bind) |
| 10 |
---*/ |
| 11 |
|
| 12 |
var foo = function() {}; |
| 13 |
var data = "data"; |
| 14 |
|
| 15 |
Object.defineProperty(Function.prototype, "prop", { |
| 16 |
get: function() { |
| 17 |
return data; |
| 18 |
}, |
| 19 |
set: function(value) { |
| 20 |
data = value; |
| 21 |
}, |
| 22 |
enumerable: true, |
| 23 |
configurable: true |
| 24 |
}); |
| 25 |
|
| 26 |
var obj = foo.bind({}); |
| 27 |
|
| 28 |
assert.sameValue(obj.hasOwnProperty("prop"), false, 'obj.hasOwnProperty("prop")'); |
| 29 |
assert.sameValue(obj.prop, data, 'obj.prop'); |