diff --git a/browser/base/content/tabview/modules/utils.jsm b/browser/base/content/tabview/modules/utils.jsm index 96a0e4877828..ab915f12cf76 100644 --- a/browser/base/content/tabview/modules/utils.jsm +++ b/browser/base/content/tabview/modules/utils.jsm @@ -666,22 +666,9 @@ let Utils = { // ---------- // Function: merge - // Merge two arrays and return the result. + // Merge two array-like objects into the first and return it. merge: function(first, second) { - var i = first.length, j = 0; - - if (typeof second.length === "number") { - for (let l = second.length; j < l; j++) { - first[i++] = second[j]; - } - } else { - while (second[j] !== undefined) { - first[i++] = second[j++]; - } - } - - first.length = i; - + Array.forEach(second, function(el) Array.push(first, el)); return first; },