@@ -90008,17 +90008,7 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
90008
90008
90009
90009
<p>Each <span>event loop</span> has a <dfn>microtask queue</dfn>. A <dfn
90010
90010
data-export="">microtask</dfn> is a <span data-x="concept-task">task</span> that is originally to
90011
- be queued on the <span>microtask queue</span> rather than a <span>task queue</span>. There are two
90012
- kinds of <span data-x="microtask">microtasks</span>: <dfn data-x="solitary callback
90013
- microtask" data-lt="solitary callback microtask" data-export="">solitary callback
90014
- microtasks</dfn>, and <dfn data-x="compound microtask" data-lt="compound microtask"
90015
- data-export="">compound microtasks</dfn>.</p>
90016
-
90017
- <p class="note">This specification only has <span data-x="solitary callback microtask">solitary
90018
- callback microtasks</span>. Specifications that use <span data-x="compound microtask">compound
90019
- microtasks</span> have to take extra care to <span data-x="execute a compound microtask
90020
- subtask">wrap callbacks</span> to handle <span data-x="spin the event loop">spinning the event
90021
- loop</span>.</p>
90011
+ be queued on the <span>microtask queue</span> rather than a <span>task queue</span>.</p>
90022
90012
90023
90013
<p>When an algorithm requires a <span>microtask</span> to be <dfn data-x="queue a
90024
90014
microtask" data-lt="queue a microtask" data-export="">queued</dfn>, it must be appended to the
@@ -90073,28 +90063,6 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
90073
90063
<li><p>Set the <span>performing a microtask checkpoint</span> flag to false.</p></li>
90074
90064
</ol>
90075
90065
90076
- <p>If, while a <span>compound microtask</span> is running, the user agent is required to
90077
- <dfn data-export="">execute a compound microtask subtask</dfn> to run a series of steps, the user
90078
- agent must run the following steps:</p>
90079
-
90080
- <ol>
90081
-
90082
- <li><p>Let <var>parent</var> be the <span>event loop</span>'s <span>currently running
90083
- task</span> (the currently running <span>compound microtask</span>).</p></li>
90084
-
90085
- <li><p>Let <var>subtask</var> be a new <span data-x="concept-task">task</span> that
90086
- consists of running the given series of steps. The <span>task source</span> of such a
90087
- <span>microtask</span> is the <span>microtask task source</span>. This is a <dfn>compound
90088
- microtask subtask</dfn>.</p></li>
90089
-
90090
- <li><p>Set the <span>event loop</span>'s <span>currently running task</span> to <var>subtask</var>.</p></li>
90091
-
90092
- <li><p>Run <var>subtask</var>.</p></li>
90093
-
90094
- <li><p>Set the <span>event loop</span>'s <span>currently running task</span> back to <var>parent</var>.</p></li>
90095
-
90096
- </ol>
90097
-
90098
90066
<hr>
90099
90067
90100
90068
<p>When an algorithm running <span>in parallel</span> is to <dfn>await a stable state</dfn>, the
@@ -90119,19 +90087,11 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
90119
90087
<p>When an algorithm says to <dfn>spin the event loop</dfn> until a condition <var>goal</var> is met, the user agent must run the following steps:</p>
90120
90088
90121
90089
<ol>
90090
+ <li><p>Let <var>task</var> be the <span>event loop</span>'s <span>currently running
90091
+ task</span>.</p></li>
90122
90092
90123
- <li>
90124
-
90125
- <p>Let <var>task</var> be the <span>event loop</span>'s <span>currently running
90126
- task</span>.</p>
90127
-
90128
- <p class="note">This might be a <span>microtask</span>, in which case it is a <span>solitary
90129
- callback microtask</span>. It could also be a <span>compound microtask subtask</span>, or a
90130
- regular <span data-x="concept-task">task</span> that is not a <span>microtask</span>. It will
90131
- <em>not</em> be a <span>compound microtask</span>.</p> <!-- well, not unless we messed up in the
90132
- speccing, anyway... -->
90133
-
90134
- </li>
90093
+ <li><p>Assert: <var>task</var> is a <span data-x="concept-task">task</span> or a
90094
+ <span>microtask</span>.</p></li>
90135
90095
90136
90096
<li><p>Let <var>task source</var> be <var>task</var>'s <span>task
90137
90097
source</span>.</p></li>
@@ -90141,17 +90101,19 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
90141
90101
90142
90102
<li><p>Empty the <span>JavaScript execution context stack</span>.</p></li>
90143
90103
90144
- <li><p><span>Perform a microtask checkpoint</span>.</p></li>
90145
-
90146
90104
<li>
90105
+ <p><span>Perform a microtask checkpoint</span>.</p>
90147
90106
90148
- <p>Stop <var>task</var>, allowing whatever algorithm that invoked it to resume, but
90149
- continue these steps <span>in parallel</span>.</p>
90107
+ <p class="note">If <var>task</var> is a <span>microtask</span> this step will be a no-op due to
90108
+ the <span>performing a microtask checkpoint</span> flag being set.</p>
90109
+ </li>
90150
90110
90151
- <p class="note">This causes one of the following algorithms to continue: the <span>event
90152
- loop</span>'s main set of steps, the <span>perform a microtask checkpoint</span> algorithm, or
90153
- the <span>execute a compound microtask subtask </span> algorithm .</p>
90111
+ <li>
90112
+ <p>Stop <var>task</var>, allowing whatever algorithm that invoked it to resume, but continue
90113
+ these steps <span>in parallel </span>.</p>
90154
90114
90115
+ <p class="note">This causes the <span>event loop</span>'s main set of steps or the <span>perform
90116
+ a microtask checkpoint</span> algorithm to continue.</p>
90155
90117
</li>
90156
90118
90157
90119
<li><p>Wait until the condition <var>goal</var> is met.</p></li>
@@ -90164,7 +90126,6 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
90164
90126
stack</var>.</p></li>
90165
90127
90166
90128
<li><p>Return to the caller.</p></li>
90167
-
90168
90129
</ol>
90169
90130
90170
90131
<hr>
0 commit comments