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

@annevk commented on this pull request.

Thanks, this looks good except for some nits.

I think it would be good to have some of the follow-up PRs against other specifications, e.g., Fetch, ready as well (at least in draft state) to ensure it works out and the complete flow can be reviewed.

> @@ -1762,25 +1763,33 @@ constructor steps are:
 <p>The <dfn attribute for=AbortController><code>signal</code></dfn> getter steps are to return
 <a>this</a>'s <a for=AbortController>signal</a>.
 
-<p>The <dfn method for=AbortController><code>abort()</code></dfn> method steps are to
-<a for=AbortSignal>signal abort</a> on <a>this</a>'s <a for=AbortController>signal</a>.
-
+<p>The <dfn method for=AbortController><code>abort(reason)</code></dfn> method steps are to

This needs `<var>` around the argument.

> @@ -1813,19 +1825,25 @@ requirements to react in a reasonable way to {{AbortController/abort()}}. For ex
 [=AbortSignal/aborted flag=] might need to be propagated to a cross-thread environment, such as a
 service worker.
 
-<p>The static <dfn method for=AbortSignal><code>abort()</code></dfn> method steps are:
+<p>The static <dfn method for=AbortSignal><code>abort(reason)</code></dfn> method steps are:

Needs `<var>` as well.

> + <li><p>Set <var>signal</var>'s [=AbortSignal/abort reason=] to <var>reason</var> if it is given,
+ and a new "{{AbortError!!exception}}" {{DOMException}} otherwise.

```suggestion
 <li><p>Set <var>signal</var>'s [=AbortSignal/abort reason=] to <var>reason</var> if it is given;
 otherwise to a new "{{AbortError!!exception}}" {{DOMException}}.
```

> + <li><p>Set <var>signal</var>'s [=AbortSignal/abort reason=] to <var>reason</var> if it is given,
+ and a new "{{AbortError!!exception}}" {{DOMException}} otherwise.

```suggestion
 <li><p>Set <var>signal</var>'s [=AbortSignal/abort reason=] to <var>reason</var> if it is given;
 otherwise to a new "{{AbortError!!exception}}" {{DOMException}}.
```

> +<p>An {{AbortSignal}} object has an associated <dfn export for=AbortSignal>abort reason</dfn>, which is a
+JavaScript value given to {{AbortController}}'s {{AbortController/abort()}}, or undefined.

```suggestion
<p>An {{AbortSignal}} object has an associated <dfn export for=AbortSignal>abort reason</dfn>, which is a
JavaScript value.
```
Also, do we need to clarify here that it can never be undefined? I guess that's not really needed.

-- 
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-785335335

Received on Thursday, 21 October 2021 08:05:51 UTC