Skip to content

Commit 3a9f481

Browse files
authored
fix fetch with coverage enabled (#2330)
1 parent 882ff6d commit 3a9f481

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/compat/dispatcher-weakref.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ class CompatFinalizer {
2222
}
2323

2424
register (dispatcher, key) {
25-
dispatcher.on('disconnect', () => {
26-
if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
27-
this.finalizer(key)
28-
}
29-
})
25+
if (dispatcher.on) {
26+
dispatcher.on('disconnect', () => {
27+
if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
28+
this.finalizer(key)
29+
}
30+
})
31+
}
3032
}
3133
}
3234

0 commit comments

Comments
 (0)