diff --git a/lib/tty.js b/lib/tty.js index 1a3fa5afe53a41..b1a2d3e7a9bc4d 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -22,7 +22,6 @@ 'use strict'; const { - Array, NumberIsInteger, ObjectSetPrototypeOf, } = primordials; @@ -111,7 +110,7 @@ function WriteStream(fd) { // Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671 this._handle.setBlocking(true); - const winSize = new Array(2); + const winSize = [0, 0]; const err = this._handle.getWindowSize(winSize); if (!err) { this.columns = winSize[0]; @@ -131,7 +130,7 @@ WriteStream.prototype.hasColors = hasColors; WriteStream.prototype._refreshSize = function() { const oldCols = this.columns; const oldRows = this.rows; - const winSize = new Array(2); + const winSize = [0, 0]; const err = this._handle.getWindowSize(winSize); if (err) { this.emit('error', new ErrnoException(err, 'getWindowSize'));