From 62e155e8716a9f9ba1de3ab340795ad9a1049468 Mon Sep 17 00:00:00 2001 From: CK Date: Mon, 31 Dec 2018 04:35:51 -0800 Subject: [PATCH] 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). --- src/scales/scale.time.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index a2892bfd6cd..099e5717e9a 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 {