promises-aplus/promises-spec — pull request #70 by domenic (2013-02-09 21:28:40+00:00)
Title: Rephrase the way asynchronicity is mandated.

As per conversations with MarkM, this is the real invariant we are trying to preserve: that the promise handlers cannot interleave with other code.

--

This should probably be discussed, as it loses a bit in clarity I think. But, it is technically more correct than our current "`then` must return before `onFulfilled` or `onRejected` is called": if you imagined a hypothetical extended JavaScript that let you schedule operations to take place after you return and then three statements have executed, our current phrasing would allow that, which is not what we want. Or if you can imagine a hypothetical JavaScript that allows you to clear the current execution stack with some magic function, that would actually be a safe time to run the callbacks, even if it's before `then` returns.

BTW the concept of the execution stack is summarized in [section 10.3 of the ES5 spec](http://es5.github.com/#x10.3)