Open jakearchibald opened 6 years ago
Microtasks will not be handled after step 2 unless those steps are surrounded by "queue a task" or similar, which is more rare. In that case we'd probably need some new way of queuing a task that makes it clear we're running JS code, yeah. For example "queue task: 1. prepare to run script; 2-4. your steps. 5. clean up after running script".
If I have a spec like:
…microtasks will be handled after step two. But there's no way to do this in a JavaScript implementation of the spec, as the stack won't be empty.
Either we need to spec the above in a way that prevents a microtask checkpoint after step two (which would be weird if the API is ever promoted into the HTML spec or whatever), or we need to provide a way to process microtasks synchronously.