From 9c83c3967279290b657e1496c254f04b47f45373 Mon Sep 17 00:00:00 2001 From: Felix Kling Date: Fri, 30 Nov 2018 17:09:34 -0800 Subject: [PATCH] Do not use .apply to flatten arrays Function calls can only receive a limited number of arguments. --- src/Runner.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Runner.js b/src/Runner.js index 3977d947..af48101f 100644 --- a/src/Runner.js +++ b/src/Runner.js @@ -63,10 +63,13 @@ const log = { }; function concatAll(arrays) { - return arrays.reduce( - (result, array) => (result.push.apply(result, array), result), - [] - ); + const result = []; + for (const array of arrays) { + for (const element of array) { + result.push(element); + } + } + return result; } function showFileStats(fileStats) {