Skip to content

Commit

Permalink
fixup: don't use EE.listenerCount
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Oct 11, 2019
1 parent e041ae3 commit f71dcd9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const { Object } = primordials;
module.exports = Writable;
Writable.WritableState = WritableState;

const EE = require('events');
const internalUtil = require('internal/util');
const Stream = require('stream');
const { Buffer } = require('buffer');
Expand Down Expand Up @@ -719,7 +718,7 @@ function onFinished(stream, state, cb) {
stream.removeListener('finish', onfinish);
stream.removeListener('error', onerror);
cb(err);
if (EE.listenerCount(stream, 'error') === 0) {
if (stream.listenerCount('error') === 0) {
stream.emit('error', err);
}
}
Expand Down

0 comments on commit f71dcd9

Please sign in to comment.