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 Apr 3, 2018
1 parent 92fce6b commit b9bacb9
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 b9bacb9

Please sign in to comment.