scopes, execution contexts, and scripts

"John J. Barton" <[email protected]> Thu, 21 Jan 2010 21:46:48 -0800
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Does anyone understand what jsdIStackframe.executionContext is? How is 
it related to jsdIStackframe.scope?

At
http://mxr.mozilla.org/mozilla/source/js/jsd/idl/jsdIDebuggerService.idl#766
we read about jsdIContext

  /* Top of the scope chain for this context. */
  readonly attribute jsdIValue     globalObject;

and at
http://mxr.mozilla.org/mozilla/source/js/jsd/idl/jsdIDebuggerService.idl#841
we read about jsdIStackframe:

      /* Top object in the scope chain. */
      readonly attribute jsdIValue      scope;

Despite the word 'top' here, in practice, you get the scope chain by 
chasing scope.jsParent. So I'm guessing that the correct comment for the 
frame.scope would be "youngest object in the scope chain".

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.

I guess that frame.executionContext is basically the container for the 
frames, which is why is not useful for anything. But I'd like to know 
more about it.

jjb