In my tern set up in emacs, this code works fine when I do `M-.` when my cursor is under the `foo` of `obj.foo()` (in the last line):

```
var obj = {};
obj.foo = function() {
    return true;
};

obj.foo();

```

But when I do the same on the following, it says "No definition found."

```
window.obj = {};
obj.foo = function() {
    return true;
};

obj.foo();

```

I tried making each refernce to `obj` as `window.obj`. Doesn't seem to help. Am I missing something?