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

@nidhijaju commented on this pull request.



> @@ -1762,8 +1763,10 @@ 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
+<a for=AbortSignal>signal abort</a> on <a>this</a>'s <a for=AbortController>signal</a>, with
+the provided <var>reason</var>. If a <var>reason</var> is not passed, create a new "{{AbortError!!exception}}"
+{{DOMException}}.

I was initially thinking the other specs could set `signal.reason` in their own specs before signaling abort where necessary. However, after thinking about it more, I've changed it now so that the "signal abort" algorithms takes the reason as an argument so it's easier for other specs to set the abort reason. 

Hopefully the most recent changes look okay?

-- 
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#discussion_r732464204

Received on Wednesday, 20 October 2021 06:54:06 UTC