Skip to content

Commit

Permalink
update Array#{flatten, flatMap} per tc39/proposal-flatMap#55
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed May 5, 2018
1 parent 2aa5e4c commit 9f4da13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/_flatten-into-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function flattenIntoArray(target, original, source, sourceLen, start, depth, map
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];

if (isArray(element) && depth > 0) {
if (depth > 0 && isArray(element)) {
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
} else {
if (targetIndex >= 0x1fffffffffffff) throw TypeError();
Expand Down

0 comments on commit 9f4da13

Please sign in to comment.