From: CK Date: Mon, 31 Dec 2018 12:35:51 +0000 (-0800) Subject: Fix RangeError exception when merging too many labels (#5936) X-Git-Tag: v2.8.0-rc.1~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8920f6b62f4e5c2e6110a64d3bfcc8f68ab3659;p=thirdparty%2FChart.js.git Fix RangeError exception when merging too many labels (#5936) Fix "RangeError: Maximum call stack size exceeded" exception when calling `Array.push.apply` with too many items (>125000). --- diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index a2892bfd6..099e5717e 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -554,7 +554,9 @@ module.exports = function() { datasets[i][j] = timestamp; } } else { - timestamps.push.apply(timestamps, labels); + for (j = 0, jlen = labels.length; j < jlen; ++j) { + timestamps.push(labels[j]); + } datasets[i] = labels.slice(0); } } else {