Skip to content

Commit

Permalink
Revert "stream: defer readable and flow when sync"
Browse files Browse the repository at this point in the history
This reverts commit 563fff2
as it was causing failures in CITGM with `dicer`.

Refs: nodejs#18515
  • Loading branch information
addaleax committed Feb 7, 2018
1 parent ee67dd0 commit 203e607
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 119 deletions.
17 changes: 5 additions & 12 deletions lib/_stream_readable.js
Expand Up @@ -488,18 +488,11 @@ function onEofChunk(stream, state) {
}
state.ended = true;

if (state.sync && state.length) {
// if we are sync and have data in the buffer, wait until next tick
// to emit the data. otherwise we risk emitting data in the flow()
// the readable code triggers during a read() call
emitReadable(stream);
} else {
// emit 'readable' now to make sure it gets picked up.
state.needReadable = false;
if (!state.emittedReadable) {
state.emittedReadable = true;
emitReadable_(stream);
}
// emit 'readable' now to make sure it gets picked up.
state.needReadable = false;
if (!state.emittedReadable) {
state.emittedReadable = true;
emitReadable_(stream);
}
}

Expand Down
67 changes: 0 additions & 67 deletions test/parallel/test-stream-pipe-flow.js

This file was deleted.

40 changes: 0 additions & 40 deletions test/parallel/test-stream-readable-pause-and-resume.js

This file was deleted.

0 comments on commit 203e607

Please sign in to comment.