Avoid leaking a data var in compat/legacy builds and remove dead code from the underscore build.

This commit is contained in:
John-David Dalton
2014-01-22 00:26:45 -08:00
parent e51aa5899a
commit 41ef391d15
7 changed files with 55 additions and 165 deletions

View File

@@ -1873,10 +1873,10 @@
arity = 0;
}
// fast path for `_.bind`
data = [func, bitmask, arity, thisArg, partialArgs, partialRightArgs];
var newData = [func, bitmask, arity, thisArg, partialArgs, partialRightArgs];
return (bitmask == BIND_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG))
? baseBind(data)
: baseCreateWrapper(data);
? baseBind(newData)
: baseCreateWrapper(newData);
}
/**
@@ -4699,7 +4699,7 @@
*/
function curry(func, arity) {
if (typeof arity != 'number') {
arity = +arity || null;
arity = +arity || (func ? func.length : 0);
}
return createWrapper(func, CURRY_FLAG, arity);
}