From f0991cc0b0d28cca69a3a5f18f8c5a47d252c1b9 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren Each event loop has a microtask queue. A microtask is a task that is originally to
- be queued on the microtask queue rather than a task queue. There are two
- kinds of microtasks: solitary callback
- microtasks, and compound microtasks. This specification only has solitary
- callback microtasks. Specifications that use compound
- microtasks have to take extra care to wrap callbacks to handle spinning the event
- loop.
When an algorithm requires a microtask to be queued, it must be appended to the @@ -90043,28 +90033,6 @@ dictionary PromiseRejectionEventInit : EventInit {
Set the performing a microtask checkpoint flag to false.
If, while a compound microtask is running, the user agent is required to - execute a compound microtask subtask to run a series of steps, the user - agent must run the following steps:
- -Let parent be the event loop's currently running - task (the currently running compound microtask).
Let subtask be a new task that - consists of running the given series of steps. The task source of such a - microtask is the microtask task source. This is a compound - microtask subtask.
Set the event loop's currently running task to subtask.
Run subtask.
Set the event loop's currently running task back to parent.
When an algorithm running in parallel is to await a stable state, the @@ -90089,19 +90057,10 @@ dictionary PromiseRejectionEventInit : EventInit {
When an algorithm says to spin the event loop until a condition goal is met, the user agent must run the following steps:
Let task be the event loop's currently running + task.
Let task be the event loop's currently running - task.
- -This might be a microtask, in which case it is a solitary - callback microtask. It could also be a compound microtask subtask, or a - regular task that is not a microtask. It will - not be a compound microtask.
- -Assert: task is not a microtask.
Let task source be task's task source.
Perform a microtask checkpoint.
Stop task, allowing whatever algorithm that invoked it to resume, but - continue these steps in parallel.
- -This causes one of the following algorithms to continue: the event - loop's main set of steps, the perform a microtask checkpoint algorithm, or - the execute a compound microtask subtask algorithm.
- -Stop task, allowing the event loop's main set of steps to resume, + but continue these steps in parallel.
Wait until the condition goal is met.
Return to the caller.
When an algorithm says to spin the event loop until a condition goal is met, the user agent must run the following steps:
Let task be the event loop's currently running - task.
Let task be the event loop's currently running task.
-Assert: task is not a microtask.
This might be a microtask or a regular task. If this is a microtask the performing a + microtask checkpoint flag is set.
+Let task source be task's task source.
Perform a microtask checkpoint.
Stop task, allowing whatever algorithm that invoked it to resume, but continue + these steps in parallel.
+ +This causes the event loop's main set of steps or the perform + a microtask checkpoint algorithm to continue.
+Stop task, allowing the event loop's main set of steps to resume, but continue these steps in parallel.
Stop task, allowing the event loop's main set of steps to resume, - but continue these steps in parallel.
Wait until the condition goal is met.
Queue a task to continue running these steps, using the task
From 2a3120ac3010d41ceffd544b008cf2f5e130fcec Mon Sep 17 00:00:00 2001
From: Anne van Kesteren When an algorithm says to spin the event loop until a condition goal is met, the user agent must run the following steps: Let task be the event loop's currently running task. Let task be the event loop's currently running
+ task. This might be a microtask or a regular task. If this is a microtask the performing a
- microtask checkpoint flag is set.
-
Assert: task is a task or a + microtask.
Let task source be task's task source.
Empty the JavaScript execution context stack.
Perform a microtask checkpoint.
Perform a microtask checkpoint.
+ +If task is a microtask this step will be a no-op due to + the performing a microtask checkpoint flag being set.
+Stop task, allowing whatever algorithm that invoked it to resume, but continue