diff --git a/lib/internal/streams/readable.js b/lib/internal/streams/readable.js index 146f712c4a2f7e..afef1edfb0bcf3 100644 --- a/lib/internal/streams/readable.js +++ b/lib/internal/streams/readable.js @@ -764,7 +764,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) { + if (dest.listenerCount('error') === 0) { const s = dest._writableState || dest._readableState; if (s && !s.errorEmitted) { // User incorrectly emitted 'error' directly on the stream. @@ -829,7 +829,7 @@ function pipeOnDrain(src, dest) { } if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && - EE.listenerCount(src, 'data')) { + src.listenerCount('data')) { src.resume(); } };