Cleanup _.compose.

This commit is contained in:
John-David Dalton
2014-01-28 22:14:10 -08:00
parent d969dcecbf
commit 63727b67ee

View File

@@ -4665,17 +4665,14 @@
*/
function compose() {
var funcs = arguments,
length = funcs.length;
funcsLength = funcs.length,
length = funcsLength;
while (length--) {
if (!isFunction(funcs[length])) {
throw new TypeError;
}
}
var funcsLength = funcs.length;
if (funcsLength === 1) {
return funcs[0];
}
return function() {
var length = funcsLength - 1,
result = funcs[length].apply(this, arguments);