@nxtedition/nxt-undici 2.0.30 → 2.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/readable.js +10 -8
- package/package.json +1 -1
package/lib/readable.js
CHANGED
|
@@ -88,15 +88,17 @@ export class BodyReadable extends Readable {
|
|
|
88
88
|
this[kHandler].signal = null
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if (err) {
|
|
92
|
+
// Workaround for Node "bug". If the stream is destroyed in same
|
|
93
|
+
// tick as it is created, then a user who is waiting for a
|
|
94
|
+
// promise (i.e micro tick) for installing a 'error' listener will
|
|
95
|
+
// never get a chance and will always encounter an unhandled exception.
|
|
96
|
+
// - tick => process.nextTick(fn)
|
|
97
|
+
// - micro tick => queueMicrotask(fn)
|
|
98
|
+
setImmediate(() => callback(err))
|
|
99
|
+
} else {
|
|
98
100
|
callback(err)
|
|
99
|
-
}
|
|
101
|
+
}
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
on(ev, ...args) {
|