Skip to content

Commit 35cef89

Browse files
committed
experimental
1 parent 2968625 commit 35cef89

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/api/globals.md

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ Returns a new `AbortSignal` which will be aborted in `delay` milliseconds.
127127
added: REPLACEME
128128
-->
129129

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

132134
Returns a new `AbortSignal` which will be aborted if any of the provided

lib/internal/abort_controller.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const {
2828
const {
2929
createDeferredPromise,
3030
customInspectSymbol,
31+
emitExperimentalWarning,
3132
kEmptyObject,
3233
kEnumerableProperty,
3334
} = require('internal/util');
@@ -195,6 +196,7 @@ class AbortSignal extends EventTarget {
195196
* @returns {AbortSignal}
196197
*/
197198
static any(signals) {
199+
emitExperimentalWarning('AbortSignal.any');
198200
validateAbortSignalArray(signals, 'signals');
199201
const resultSignal = createAbortSignal({ composite: true });
200202
const resultSignalWeakRef = new WeakRef(resultSignal);
@@ -365,8 +367,7 @@ function abortSignal(signal, reason) {
365367
signal.dispatchEvent(event);
366368
signal[kDependantSignals]?.forEach((s) => {
367369
const signalRef = s.deref();
368-
if (!signalRef) return;
369-
abortSignal(signalRef, reason);
370+
if (signalRef) abortSignal(signalRef, reason);
370371
});
371372
}
372373

0 commit comments

Comments
 (0)