From 7a67a2f1a49ac35f700ced4421b6c8d2df77104a Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Mon, 17 Jan 2022 21:03:54 +0200 Subject: [PATCH] fixup! --- lib/internal/streams/operators.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/streams/operators.js b/lib/internal/streams/operators.js index 14d6b86416f11d..f93e2a1af9fc78 100644 --- a/lib/internal/streams/operators.js +++ b/lib/internal/streams/operators.js @@ -156,12 +156,12 @@ async function some(fn, options) { // Note that some does short circuit but also closes the iterator if it does const ac = new AbortController(); if (options?.signal) { - options?.signal?.addEventListener('abort', ac.abort.bind(ac), { + options?.signal?.addEventListener('abort', () => ac.abort(), { [kWeakHandler]: this, once: true, }); } - const mapped = this.map(fn, { ...(options ?? {}), signal: ac.signal }); + const mapped = this.map(fn, { ...options, signal: ac.signal }); for await (const result of mapped) { if (result) { ac.abort();