<pre><code>var A = {
    x : function () { }
};

var b = function (method) {
    //want to know method's "parent" here
};

b(A.x);
</code></pre>

<p>I want to know that x is defined in A when I call the b(A.x). Is this possible?</p>

There's no nice built-in way to do this, because actually there are no methods in Javascript. They are independent Function objects that just happen to be assigned somewhere.
If you create new instance of function every time (e.g. closure)
[thanks Matthew Crumley for pointing that out]
, then you can modify the function object to explicitly associate it with its parent:
```
```
x.parent = A;
```
```
and then you can call it properly as if it was a method:
```
```
x.call(x.parent);
```
```
Otherwise you will have to pass both function and its parent object.