Re: scopes, execution contexts, and scripts
John J Barton <[email protected]> Fri, 22 Jan 2010 12:31:42 -0800
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
Boris Zbarsky wrote: > On 1/22/10 11:26 AM, John J. Barton wrote: >>>> If I apply the same correction to the globalObject for jsdIContext we'd >>>> have "youngest scope for this context", but that does not make any more >>>> sense to me. >>> >>> Sure. That's because there's no age anything going on there. >> >> So outermost scope. Or last-to-be-used-for lookup. > > As it happens, no. Lookups follow the parent and prototype chains. > Where those terminate depends on the embedding. In the Firefox case, > for example, the outermost scope is the inner window's JSObject (whereas > the context's global is the outer window's JSObject). > > In particular, when you navigate from one page to another the outermost > scope becomes a new object whereas the context's global doesn't change > object identity (though it does have al tis properties removed). Somehow Firebug manages to work despite having no understanding of these subtle issues ;-) > >> "That sort of thing" needs to be sorted out. esp setTimeout and >> setInterval. > > setTimeout and setInterval run on the JSContext of the window they were > set on. But how can I enumerate these things? jjb