Skip to content

Commit

Permalink
Fix RangeError exception when merging too many labels (chartjs#5936)
Browse files Browse the repository at this point in the history
Fix "RangeError: Maximum call stack size exceeded" exception when calling `Array.push.apply` with too many items (>125000).
  • Loading branch information
ckyycc authored and simonbrunel committed Dec 31, 2018
1 parent 4b6e53a commit a8920f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scales/scale.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a8920f6

Please sign in to comment.