Skip to content

Commit

Permalink
stream: update emit readable debug statement
Browse files Browse the repository at this point in the history
Currently, the debug statement in emitReadable is `emit readable` which
can be interpreted as the readable event is going to be emitted. But
I think the intent of this debug statment is just that the
emitReadable_ function was entered. If that was not the intent then
perhaps the debug statment should be moved into the if statement below
it.

PR-URL: #22613
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
danbev authored and targos committed Sep 3, 2018
1 parent 9a10421 commit 4ed300a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_stream_readable.js
Expand Up @@ -529,7 +529,7 @@ function emitReadable(stream) {

function emitReadable_(stream) {
var state = stream._readableState;
debug('emit readable');
debug('emitReadable_', state.destroyed, state.length, state.ended);
if (!state.destroyed && (state.length || state.ended)) {
stream.emit('readable');
}
Expand Down

0 comments on commit 4ed300a

Please sign in to comment.