Promise clause 2.2.4 / a + spec says:
onFulfilled or onRejected should not be called until the context stack contains only platform code.
The notes then say that:
Here, "platform code" means an engine, an environment, and a promise of implementation code. In practice, this requirement ensures that onFulfilled and onRejected are executed asynchronously after the loop turn event, which is then invoked, and with a fresh stack.
Is this the intention to ensure that when a chain has a large number of onFulfilled functions, their execution does not block the flow?
Or is there something else between the lines that I am not reading?
javascript promise es6-promise event-loop
Cuipengfei
source share