Skip to content

Commit

Permalink
experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
atlowChemi committed May 5, 2023
1 parent 38c07f8 commit 07b8012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ Returns a new `AbortSignal` which will be aborted in `delay` milliseconds.
added: REPLACEME
-->

> Stability: 1 - Experimental
* `signals` {AbortSignal\[]} The `AbortSignal`s of which to compose a new `AbortSignal`.

Returns a new `AbortSignal` which will be aborted if any of the provided
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/abort_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const {
const {
createDeferredPromise,
customInspectSymbol,
emitExperimentalWarning,
kEmptyObject,
kEnumerableProperty,
} = require('internal/util');
Expand Down Expand Up @@ -195,6 +196,7 @@ class AbortSignal extends EventTarget {
* @returns {AbortSignal}
*/
static any(signals) {
emitExperimentalWarning('AbortSignal.any');
validateAbortSignalArray(signals, 'signals');
const resultSignal = createAbortSignal({ composite: true });
const resultSignalWeakRef = new WeakRef(resultSignal);
Expand Down Expand Up @@ -365,8 +367,7 @@ function abortSignal(signal, reason) {
signal.dispatchEvent(event);
signal[kDependantSignals]?.forEach((s) => {
const signalRef = s.deref();
if (!signalRef) return;
abortSignal(signalRef, reason);
if (signalRef) abortSignal(signalRef, reason);
});
}

Expand Down

0 comments on commit 07b8012

Please sign in to comment.