Re: scopes, execution contexts, and scripts

"John J. Barton" <[email protected]> Sun, 24 Jan 2010 23:34:03 -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).

I wonder if this is may help explain why Chromebug never works properly.

I have three interconnected problems. First I end up maintaining refs to 
windows with names "about:blank". I don't know what these are.  Second I 
end up maintaining refs to windows with chrome URL names but that have 
been destroyed (window.closed == true). Third, if I set an unload 
handler on the window and remove the refs, then some of my chrome URL 
window data is lost.

I have a decent solution for finding objects as they arrive but I can't 
figure out how to un-find them when they leave.  Maybe my ideas about 
what defines object identity is incorrect.

jjb