diff --git a/lib/tty.js b/lib/tty.js index 54a7b756ec9544..c00f2f5e796b34 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -66,7 +66,7 @@ function WriteStream(fd) { // Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671 if (process.platform === 'darwin') this._handle.setBlocking(true); - var winSize = []; + var winSize = new Array(2); var err = this._handle.getWindowSize(winSize); if (!err) { this.columns = winSize[0]; @@ -83,7 +83,7 @@ WriteStream.prototype.isTTY = true; WriteStream.prototype._refreshSize = function() { var oldCols = this.columns; var oldRows = this.rows; - var winSize = []; + var winSize = new Array(2); var err = this._handle.getWindowSize(winSize); if (err) { this.emit('error', errnoException(err, 'getWindowSize'));