Bump to v4.5.1.

This commit is contained in:
John-David Dalton
2016-02-21 20:49:38 -08:00
parent 2b1eb3f480
commit 9055c4e483
30 changed files with 143 additions and 91 deletions

View File

@@ -2,6 +2,7 @@ import apply from './_apply';
import createCtorWrapper from './_createCtorWrapper';
import createHybridWrapper from './_createHybridWrapper';
import createRecurryWrapper from './_createRecurryWrapper';
import getPlaceholder from './_getPlaceholder';
import replaceHolders from './_replaceHolders';
import root from './_root';
@@ -19,10 +20,9 @@ function createCurryWrapper(func, bitmask, arity) {
function wrapper() {
var length = arguments.length,
index = length,
args = Array(length),
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func,
placeholder = wrapper.placeholder;
index = length,
placeholder = getPlaceholder(wrapper);
while (index--) {
args[index] = arguments[index];
@@ -32,9 +32,13 @@ function createCurryWrapper(func, bitmask, arity) {
: replaceHolders(args, placeholder);
length -= holders.length;
return length < arity
? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length)
: apply(fn, this, args);
if (length < arity) {
return createRecurryWrapper(
func, bitmask, createHybridWrapper, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length);
}
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
return wrapper;
}