Re: [whatwg/dom] Add abort reason to AbortSignal (PR #1027)

@domenic approved this pull request.

LGTM with nits

> @@ -1114,8 +1114,8 @@ participate in a tree structure.</p>
  <a>service worker events</a>, then <a>report a warning to the console</a> that this might not give
  the expected results. [[!SERVICE-WORKERS]]
 
- <li><p>If <a for="event listener">signal</a> is not null and its [=AbortSignal/aborted flag=] is
- set, then return.
+ <li><p>If <a for="event listener">signal</a> is not null and is [=AbortSignal/aborted=], then

```suggestion
 <li><p>If <var>listener</var>'s <a for="event listener">signal</a> is not null and is [=AbortSignal/aborted=], then
```

> + <dt><code><var>controller</var> . <a method for=AbortController lt=abort()>abort</a>
+ (<var>reason</var>)</code>

```suggestion
 <dt><code><var>controller</var> . <a method for=AbortController lt=abort()>abort</a(<var>reason</var>)</code>
```

> @@ -1741,9 +1741,11 @@ interface AbortController {
  <dt><code><var>controller</var> . <a attribute for=AbortController>signal</a></code>
  <dd>Returns the {{AbortSignal}} object associated with this object.
 
- <dt><code><var>controller</var> . <a method for=AbortController lt=abort()>abort</a>()</code>
- <dd>Invoking this method will set this object's {{AbortSignal}}'s [=AbortSignal/aborted flag=] and
- signal to any observers that the associated activity is to be aborted.
+ <dt><code><var>controller</var> . <a method for=AbortController lt=abort()>abort</a>
+ (<var>reason</var>)</code>
+ <dd>Invoking this method will store <var>reason</var> in this object's {{AbortSignal}}'s
+ [=AbortSignal/abort reason=], and signal to any observers that the associated activity is to be
+ aborted.

We should probably state what happens if no _reason_ is provided. E.g.

> If _reason_ is undefined, then an "`AbortError`" `DOMException` will be used.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1027#pullrequestreview-793271703

Received on Friday, 29 October 2021 17:08:16 UTC