Manipulation of the execution context stack

Ian Hickson ian at hixie.ch
Mon Jul 21 13:29:19 PDT 2014


On Mon, 21 Jul 2014, Allen Wirfs-Brock wrote:
> On Jul 21, 2014, at 11:23 AM, Ian Hickson wrote:
> > 
> > 8.5 Initialization step 4 says "Push newContext onto the execution 
> > context stack", and step 8 calls NextTask. 8.4.2 NextTask suspends the 
> > running execution context in step 2, then in step 3 asserts "The 
> > execution context stack is now empty". However, I can't find anything 
> > in the prose around suspension that actually pops the execution 
> > context stack. Am I missing something?
> 
> A job (task in the version you're looking at)

Is there a more up to date version I can look at? I couldn't quite work 
out what the canonical file to look at was. I've been using this:

   http://people.mozilla.org/~jorendorff/es6-draft.html


> is always initialized (by NextJob) with an empty execution context 
> stack.

What step in NextJob does this? It seems that step 3 asserts it, but step 
1 doesn't seem to affect the stack, and step 2 refers to the "suspend" 
prose, which seems mostly non-normative (I can't quite tell it's normative 
status -- there's no step-by-step algorithms, which seems to be the way 
the ES spec indications normativity, but there's no RFC2119-style prose 
either, so I can't tell the descriptive statements in that section from 
the prescriptive ones).


> NextJob creates a root execution context and then transfers control (a 
> goto, not a call)

As phrased it's more like a tail-call, but the three are black-box 
indistinguishable at the spec level, so that's somewhat academic.


> [...] We are essentially faking up an initial current job state that 
> NextJob can switch out of when scheduling the first real job.

I guess what I'm saying is that it's not clear to me where the "switch 
out" step happens. Do you have a pointer?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the es-discuss mailing list