Skip to content

Commit 62e155e

Browse files
ckyyccsimonbrunel
authored andcommitted
Fix RangeError exception when merging too many labels (chartjs#5936)
Fix "RangeError: Maximum call stack size exceeded" exception when calling `Array.push.apply` with too many items (>125000).
1 parent 061c1ca commit 62e155e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/scales/scale.time.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,9 @@ module.exports = function() {
554554
datasets[i][j] = timestamp;
555555
}
556556
} else {
557-
timestamps.push.apply(timestamps, labels);
557+
for (j = 0, jlen = labels.length; j < jlen; ++j) {
558+
timestamps.push(labels[j]);
559+
}
558560
datasets[i] = labels.slice(0);
559561
}
560562
} else {

0 commit comments

Comments
 (0)