Ensure _.ary treats negative n values as 0.

This commit is contained in:
jdalton
2015-01-25 12:12:41 -08:00
parent ed61d0c591
commit 47a5b227cc
2 changed files with 11 additions and 1 deletions

View File

@@ -6683,7 +6683,7 @@
if (guard && isIterateeCall(func, n, guard)) {
n = null;
}
n = n == null ? func.length : (+n || 0);
n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
return createWrapper(func, ARY_FLAG, null, null, null, null, n);
}