Ensure _.flow and _.flowRight return an identity function when no arguments are provided. [closes #938]

This commit is contained in:
jdalton
2015-02-06 22:45:58 -08:00
parent 35fa977981
commit 82c7a22d27
2 changed files with 5 additions and 5 deletions

View File

@@ -7207,7 +7207,7 @@
length = funcs.length;
if (!length) {
return function() {};
return function() { return arguments[0]; };
}
if (!arrayEvery(funcs, isFunction)) {
throw new TypeError(FUNC_ERROR_TEXT);
@@ -7252,7 +7252,7 @@
fromIndex = funcs.length - 1;
if (fromIndex < 0) {
return function() {};
return function() { return arguments[0]; };
}
if (!arrayEvery(funcs, isFunction)) {
throw new TypeError(FUNC_ERROR_TEXT);