From 315ad27def309a9df38d928ae737116ee5cb2f23 Mon Sep 17 00:00:00 2001 From: PSVM-J <39494832+PSVM-J@users.noreply.github.com> Date: Thu, 12 Jul 2018 22:21:05 +0300 Subject: [PATCH] Fixed. Array.fill() doesn't work with an empty array. --- modules/@amperka/quaddisplay2.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/@amperka/quaddisplay2.js b/modules/@amperka/quaddisplay2.js index aef2815..c6f19a3 100644 --- a/modules/@amperka/quaddisplay2.js +++ b/modules/@amperka/quaddisplay2.js @@ -51,16 +51,16 @@ QuadDisplay.prototype.display = function(str, alignRight) { if (alignRight) { if (this._data.length < 4) { - this._data = [].fill(SYMBOLS[' '], 0, 4 - this._data.length).concat(this._data); + this._data = new Array(4 - this._data.length).fill(SYMBOLS[' '], 0).concat(this._data); } - this.frame(this._data.length - 4); + this.frame(this._data.length - 4); } else { if (this._data.length < 4) { - this._data = this._data.concat([].fill(SYMBOLS[' '], 0, 4 - this._data.length)) + this._data = this._data.concat(new Array(4 - this._data.length).fill(SYMBOLS[' '], 0)); } this.frame(0); } - + }; QuadDisplay.prototype.marquee = function(str, period) {