use setImmediate everywhere.

This commit is contained in:
Christopher Jeffrey 2015-01-31 12:26:19 -08:00
parent a9153aeef5
commit 1795cd93d6
2 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,8 @@ var Tput = require('./tput')
, colors = require('./colors')
, slice = Array.prototype.slice;
var nextTick = global.setImmediate || process.nextTick.bind(process);
/**
* Program
*/
@ -1283,7 +1285,7 @@ Program.prototype._buffer = function(text) {
this._buf = text;
process.nextTick(this._flush);
nextTick(this._flush);
};
Program.prototype.flush = function(text) {

View File

@ -6496,7 +6496,7 @@ function Terminal(options) {
});
this.on('resize', function() {
setImmediate(function() {
nextTick(function() {
self.term.resize(self.width - self.iwidth, self.height - self.iheight);
});
});