Index: src/messages.js |
=================================================================== |
--- src/messages.js (revision 5238) |
+++ src/messages.js (working copy) |
@@ -707,14 +707,20 @@ |
// See if we can find a unique property on the receiver that holds |
// this function. |
var ownName = this.fun.name; |
- if (ownName && this.receiver && this.receiver[ownName] === this.fun) |
+ if (ownName && this.receiver && |
+ (ObjectLookupGetter.call(this.receiver, ownName) === this.fun || |
+ ObjectLookupSetter.call(this.receiver, ownName) === this.fun || |
+ this.receiver[ownName] === this.fun)) { |
// To handle DontEnum properties we guess that the method has |
// the same name as the function. |
return ownName; |
+ } |
var name = null; |
for (var prop in this.receiver) { |
- if (this.receiver[prop] === this.fun) { |
- // If we find more than one match bail out to avoid confusion |
+ if (this.receiver.__lookupGetter__(prop) === this.fun || |
+ this.receiver.__lookupSetter__(prop) === this.fun || |
+ (!this.receiver.__lookupGetter__(prop) && this.receiver[prop] === this.fun)) { |
+ // If we find more than one match bail out to avoid confusion. |
if (name) |
return null; |
name = prop; |