diff --git a/lib/_debugger.js b/lib/_debugger.js index 19c26aa943..239220962d 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -36,7 +36,7 @@ exports.start = function(argv, stdin, stdout) { } // Setup input/output streams - stdin = stdin || process.openStdin(); + stdin = stdin || process.stdin; stdout = stdout || process.stdout; var args = ['--debug-brk'].concat(argv), diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index f7790c6625..3a65b53fe0 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -521,6 +521,7 @@ Readable.prototype.addListener = Readable.prototype.on; // If the user uses them, then switch into old mode. Readable.prototype.resume = function() { emitDataEvents(this); + this.read(0); }; Readable.prototype.pause = function() { @@ -566,6 +567,8 @@ function emitDataEvents(stream, startPaused) { process.nextTick(function() { stream.emit('readable'); }); + else + this.read(0); }; // now make it start, just in case it hadn't already.