diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2022-12-20 11:37:50 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 03:37:50 +0100 |
commit | 948f85216a15e4ef489af21bb532a9b201b0364c (patch) | |
tree | 35c2bbfa021cf9a4190ab803ed091c5547bfe9f4 /ext/web/03_abort_signal.js | |
parent | 2ac575abfb75dc4533306c80240cb1beeb816b9b (diff) |
chore: Update dlint (#17031)
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
Diffstat (limited to 'ext/web/03_abort_signal.js')
-rw-r--r-- | ext/web/03_abort_signal.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/web/03_abort_signal.js b/ext/web/03_abort_signal.js index 2fa3c4bcf..70511a934 100644 --- a/ext/web/03_abort_signal.js +++ b/ext/web/03_abort_signal.js @@ -9,6 +9,8 @@ const { Event, setIsTrusted, defineEventHandler } = window.__bootstrap.event; const { EventTarget, listenerCount } = window.__bootstrap.eventTarget; const { + SafeArrayIterator, + SafeSetIterator, Set, SetPrototypeAdd, SetPrototypeDelete, @@ -76,7 +78,7 @@ } this[abortReason] = reason; if (this[abortAlgos] !== null) { - for (const algorithm of this[abortAlgos]) { + for (const algorithm of new SafeSetIterator(this[abortAlgos])) { algorithm(); } this[abortAlgos] = null; @@ -124,14 +126,14 @@ // only be used by Deno internals, which use it to essentially cancel async // ops which would block the event loop. addEventListener(...args) { - super.addEventListener(...args); + super.addEventListener(...new SafeArrayIterator(args)); if (this[timerId] !== null && listenerCount(this, "abort") > 0) { refTimer(this[timerId]); } } removeEventListener(...args) { - super.removeEventListener(...args); + super.removeEventListener(...new SafeArrayIterator(args)); if (this[timerId] !== null && listenerCount(this, "abort") === 0) { unrefTimer(this[timerId]); } |