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; }; diff --git a/lib/tty.js b/lib/tty.js index ee6c0407f6a135..72efcd078b2892 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -17,23 +17,17 @@ function ReadStream(fd, options) { if (!(this instanceof ReadStream)) return new ReadStream(fd, options); - // pauseOnCreate to avoid reading from the sytem buffer options = util._extend({ highWaterMark: 0, readable: true, writable: false, - handle: new TTY(fd, true), - pauseOnCreate: true + handle: new TTY(fd, true) }, options); net.Socket.call(this, options); this.isRaw = false; this.isTTY = true; - - // Let the stream resume automatically when 'data' event handlers - // are added, even though it was paused on creation - this._readableState.flowing = null; } inherits(ReadStream, net.Socket);