Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,7 @@ interface AbortSignal : EventTarget {
readonly attribute boolean aborted;
readonly attribute any reason;
undefined throwIfAborted();
undefined addAbortCallback(VoidFunction callback);

attribute EventHandler onabort;
};</pre>
Expand Down Expand Up @@ -2037,6 +2038,26 @@ is [=AbortSignal/aborted=]; otherwise false.
<p>The <dfn method for=AbortSignal>throwIfAborted()</dfn> method steps are to throw <a>this</a>'s
<a for=AbortSignal>abort reason</a>, if <a>this</a> is [=AbortSignal/aborted=].

<div algorithm>
<p>The <dfn method for=AbortSignal><code>addAbortCallback(<var>callback</var>)</code></dfn> method steps are:

<ol>
<li><p>If <a>this</a> is [=AbortSignal/aborted=], then:
<ol>
<li><p><a spec=webidl>invoke</a> <var>callback</var> with « », and "<code>report</code>".

<li><p>Return.
</ol>


<li>
<p>[=AbortSignal/Add|Add the following abort steps=] to [=this=]:</p>
<ol>
<li><p><a spec=webidl>invoke</a> <var>callback</var> with « », and "<code>report</code>".
</ol>
</ol>
</div>

<div class=example id=example-throwifaborted>
<p>This method is primarily useful for when functions accepting {{AbortSignal}}s want to throw (or
return a rejected promise) at specific checkpoints, instead of passing along the {{AbortSignal}}
Expand Down