Revert "stream: emit 'pause' on nextTick"

This reverts commit ace1009456380251f75c7151236064d3a7476f5b.

The offending commit broke certain usages of piping from stdin.

Fixes: https://github.com/nodejs/node/issues/5927
PR-URL: https://github.com/nodejs/node/pull/5947
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Evan Lucas 2016-03-29 08:09:27 -05:00
parent c7138e9cca
commit 89abe86808

View File

@ -738,8 +738,7 @@ Readable.prototype.pause = function() {
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
// Emit 'pause' on next tick as we do for 'resume'
process.nextTick(() => this.emit('pause'));
this.emit('pause');
}
return this;
};