Permalink
Browse files

no need to check error listener count

EventEmitter does this already.
  • Loading branch information...
1 parent 836a06f commit 581a79bb786bf6ca64fb23cbe5d8294dc3500a1b @andrewrk committed Oct 4, 2012
Showing with 0 additions and 3 deletions.
  1. +0 −3 lib/stream.js
View
@@ -77,9 +77,6 @@ Stream.prototype.pipe = function(dest, options) {
// don't leave dangling pipes when there are errors.
function onerror(er) {
cleanup();
- if (this.listeners('error').length === 0) {
- throw er; // Unhandled stream error in pipe.
- }
}
source.on('error', onerror);

1 comment on commit 581a79b

@skenqbx
skenqbx commented on 581a79b Oct 4, 2012

Actually the EventEmitter won't throw as onerror listens on the event.

Please sign in to comment.