Skip to content

Commit 3da7ea0

Browse files
VoltrexKeyvatargos
authored andcommitted
stream: avoid usage of deprecated APIs
Avoid usage of the `events.listenerCount()` method as it is deprecated. PR-URL: #41871 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
1 parent 02c407c commit 3da7ea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/streams/readable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
764764
debug('onerror', er);
765765
unpipe();
766766
dest.removeListener('error', onerror);
767-
if (EE.listenerCount(dest, 'error') === 0) {
767+
if (dest.listenerCount('error') === 0) {
768768
const s = dest._writableState || dest._readableState;
769769
if (s && !s.errorEmitted) {
770770
// User incorrectly emitted 'error' directly on the stream.
@@ -829,7 +829,7 @@ function pipeOnDrain(src, dest) {
829829
}
830830

831831
if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) &&
832-
EE.listenerCount(src, 'data')) {
832+
src.listenerCount('data')) {
833833
src.resume();
834834
}
835835
};

0 commit comments

Comments
 (0)