Re: [whatwg/dom] Add AbortSignal.any() (PR #1152)

@cdumez commented on this pull request.



>  
 <p class=note>The [=AbortSignal/abort algorithms=] enable APIs with complex
 requirements to react in a reasonable way to {{AbortController/abort()}}. For example, a given API's
 [=AbortSignal/abort reason=] might need to be propagated to a cross-thread environment, such as a
 service worker.
 
+<p>An {{AbortSignal}} object has a <dfn for="AbortSignal">dependent</dfn> (a boolean), which is

Do we really need this flag? Why can't we rely on `source signals` being non-empty?

> +    <p>If <var>signal</var>'s [=AbortSignal/dependent=] is false, then:
+
+    <ol>
+     <li><p><a for=set>Append</a> <var>signal</var> to <var>resultSignal</var>'s
+     [=AbortSignal/source signals=].
+
+     <li><p><a for=set>Append</a> <var>resultSignal</var> to <var>signal</var>'s
+     [=AbortSignal/dependent signals=].
+    </ol>
+
+   <li>
+    <p>Otherwise, <a for=list>for each</a> <var>sourceSignal</var> of <var>signal</var>'s
+    [=AbortSignal/source signals=]:
+
+    <ol>
+     <li><p>Assert: <var>sourceSignal</var> is not [=AbortSignal/aborted=] and not

It is not clear to me what ensure that the second part of the assertion holds. How do we know for sure that AbortSignal.any() cannot be called with an AbortSignal parameter that has it's `dependent` flag set?

Maybe we should recursively go through source signals?

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

Message ID: <whatwg/dom/pull/1152/review/1429503149@github.com>

Received on Tuesday, 16 May 2023 22:09:40 UTC