We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d402e2a commit f70772dCopy full SHA for f70772d
lib/internal/abort_controller.js
@@ -197,7 +197,10 @@ class AbortSignal extends EventTarget {
197
static any(signals) {
198
validateAbortSignalArray(signals, 'signals');
199
const resultSignal = createAbortSignal({ composite: true });
200
- const resultSignalWeakRef = new WeakRef(resultSignal);
+ let resultSignalWeakRef;
201
+ if (signals.length) {
202
+ resultSignalWeakRef ??= new WeakRef(resultSignal);
203
+ }
204
resultSignal[kSourceSignals] = new SafeSet();
205
for (let i = 0; i < signals.length; i++) {
206
const signal = signals[i];
0 commit comments