Skip to content

Commit 2a4905b

Browse files
authored
Update for AbortSignal's abort reason (#53)
Part of whatwg/dom#1030.
1 parent 2b0606e commit 2a4905b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spec/scheduling-tasks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ integrate the API into existing code that uses {{AbortSignal|AbortSignals}}.
7171
<dt><code>result = scheduler . {{Scheduler/postTask()|postTask}}( |callback|, |options| )</code></dt>
7272
<dd>
7373
<p>Returns a promise that is fulfilled with the return value of |callback|,
74-
or rejected with an "{{AbortError!!exception}}" {{DOMException}} if the task
75-
is aborted. If |callback| throws an error during execution, the promise
74+
or rejected with the {{AbortSignal}}'s [=AbortSignal/abort reason=] if the
75+
task is aborted. If |callback| throws an error during execution, the promise
7676
returned by {{Scheduler/postTask()}} will be rejected with that error.
7777

7878
<p>The task's {{TaskPriority|priority}} is determined by the combination of
@@ -115,7 +115,7 @@ task queue=]. This map is initialized to a new empty [=map=].
115115

116116
Note: We implement *dynamic prioritization* by enqueuing tasks associated with
117117
a specific {{TaskSignal}} into the same [=scheduler task queue=], and changing
118-
that queue's priority in response to `prioritychange` events. The
118+
that queue's priority in response to `prioritychange` events. The
119119
[=Scheduler/dynamic priority task queue map=] holds the
120120
[=scheduler task queues=] whose priorities can change, and the map key is the
121121
{{TaskSignal}} which all tasks in the queue are associated with.
@@ -237,9 +237,9 @@ Processing Model {#sec-scheduling-tasks-processing-model}
237237
1. Let |signal| be |options|["{{SchedulerPostTaskOptions/signal}}"] if
238238
|options|["{{SchedulerPostTaskOptions/signal}}"] [=map/exists=], or
239239
otherwise null.
240-
1. If |signal| is not null and its [=AbortSignal/aborted flag=] is set, then
241-
[=reject=] |result| with an "{{AbortError!!exception}}" {{DOMException}}
242-
and return |result|.
240+
1. If |signal| is not null and it is [=AbortSignal/aborted=], then
241+
[=reject=] |result| with |signal|'s [=AbortSignal/abort reason=] and return
242+
|result|.
243243
1. Let |priority| be |options|["{{SchedulerPostTaskOptions/priority}}"] if
244244
|options|["{{SchedulerPostTaskOptions/priority}}"] [=map/exists=], or
245245
otherwise null.
@@ -321,7 +321,7 @@ to account for current throttling techniques (see also
321321
1. If |signal| is not null, then [=AbortSignal/add|add the following=] abort
322322
steps to it:
323323
1. [=scheduler task queue/Remove=] |task| from |queue|.
324-
1. [=Reject=] |result| with an "{{AbortError!!exception}}" {{DOMException}}.
324+
1. [=Reject=] |result| with |signal|'s [=AbortSignal/abort reason=].
325325

326326
Issue: Because this algorithm can be called from [=in parallel=] steps, parts
327327
of this and other algorithms are racy. Specifically, the

0 commit comments

Comments
 (0)