From 89abe8680864d982022d9488ce30a3182afa67ee Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Tue, 29 Mar 2016 08:09:27 -0500 Subject: [PATCH] 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 Reviewed-By: Alexis Campailla Reviewed-By: Colin Ihrig --- lib/_stream_readable.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 2ee59b4286496d..338bf2a7539bfc 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -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; };