Skip to content

Commit babed9c

Browse files
authored
fix: remove unnecessary WeakRef (#2000)
It's sufficient that the finalizer removes the closure. Fixes: #1926
1 parent a0afde8 commit babed9c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/fetch/request.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,8 @@ class Request {
354354
if (signal.aborted) {
355355
ac.abort(signal.reason)
356356
} else {
357-
const acRef = new WeakRef(ac)
358357
const abort = function () {
359-
acRef.deref()?.abort(this.reason)
358+
ac.abort(this.reason)
360359
}
361360

362361
if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {

0 commit comments

Comments
 (0)