[whatwg/dom] Prevent AbortSignal.any() from causing duplicates in source signals (PR #1244)

Step 4.2.2. of [create a dependent abort signal](https://dom.spec.whatwg.org/#create-a-dependent-abort-signal) prevents duplicated signals in [source signals](https://dom.spec.whatwg.org/#abortsignal-source-signals) for example in the following snippet
```
const controller = new AbortController();
const signal = AbortSignal.any([ controller.signal, AbortSignal.any([controller.signal]) ]);
```
so maybe the same should hold for 
```
const signal2 = AbortSignal.any([ AbortSignal.any([controller.signal]), controller.signal ]);
const signal2 = AbortSignal.any([ controller.signal, controller.signal ]);
```
To my knowledge, duplicated signals in source signals should not have any impact due to step 1 of [signal abort](https://dom.spec.whatwg.org/#abortsignal-signal-abort) ensuring signals are only aborted once. So this change should cause no behavior change.

### PR Questions

- [ ] At least two implementers are interested (and none opposed):
   * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt):
   * There already is https://github.com/web-platform-tests/wpt/blob/2fcb60d7e9f294400c6274d964428621ca6cd3d2/dom/abort/resources/abort-signal-any-tests.js#L81C1-L88C72
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: …
   * Gecko: …
   * WebKit: …
   * Deno (only for aborting and events): …
   * Node.js (only for aborting and events): …
- [ ] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: …
- [ ] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use.

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/1244

-- Commit Summary --

  * Prevent AbortSignal.any([x, x]) from causing duplicates in source signals.

-- File Changes --

    M dom.bs (3)

-- Patch Links --

https://github.com/whatwg/dom/pull/1244.patch
https://github.com/whatwg/dom/pull/1244.diff

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

Message ID: <whatwg/dom/pull/1244@github.com>

Received on Tuesday, 9 January 2024 11:53:29 UTC