Skip to content

Commit 57e292d

Browse files
committed
stream: avoid usage of deprecated APIs
Avoid usage of the `events.listenerCount()` method as it is deprecated.
1 parent ff90d95 commit 57e292d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/streams/readable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
787787
debug('onerror', er);
788788
unpipe();
789789
dest.removeListener('error', onerror);
790-
if (EE.listenerCount(dest, 'error') === 0) {
790+
if (dest.listenerCount('error') === 0) {
791791
const s = dest._writableState || dest._readableState;
792792
if (s && !s.errorEmitted) {
793793
// User incorrectly emitted 'error' directly on the stream.
@@ -852,7 +852,7 @@ function pipeOnDrain(src, dest) {
852852
}
853853

854854
if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) &&
855-
EE.listenerCount(src, 'data')) {
855+
src.listenerCount('data')) {
856856
src.resume();
857857
}
858858
};

0 commit comments

Comments
 (0)