Skip to content

Commit

Permalink
stream: remove ambiguous code
Browse files Browse the repository at this point in the history
PR-URL: nodejs#29664
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
ronag committed Jan 18, 2020
1 parent 4eebd39 commit ba74fd8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/internal/streams/end-of-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,13 @@ function eos(stream, opts, callback) {
};

const onfinish = () => {
writable = false;
writableFinished = true;
if (!readable) callback.call(stream);
if (!readable || readableEnded) callback.call(stream);
};

const onend = () => {
readable = false;
readableEnded = true;
if (!writable) callback.call(stream);
if (!writable || writableFinished) callback.call(stream);
};

const onclose = () => {
Expand Down

0 comments on commit ba74fd8

Please sign in to comment.