mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Update builds after cleanup.
This commit is contained in:
55
dist/lodash.underscore.js
vendored
55
dist/lodash.underscore.js
vendored
@@ -388,16 +388,18 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The base implementation of `_.bind` without `func` type checking or support
|
||||
* for setting meta data.
|
||||
* The base implementation of `_.bind` that creates the bound function and
|
||||
* sets its meta data.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to bind.
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @param {Array} [partialArgs] An array of arguments to be partially applied.
|
||||
* @param {Array} bindData The bind data array.
|
||||
* @returns {Function} Returns the new bound function.
|
||||
*/
|
||||
function baseBind(func, thisArg, partialArgs) {
|
||||
function baseBind(bindData) {
|
||||
var func = bindData[0],
|
||||
partialArgs = bindData[2],
|
||||
thisArg = bindData[4];
|
||||
|
||||
function bound() {
|
||||
// `Function#bind` spec
|
||||
// http://es5.github.io/#x15.3.4.5
|
||||
@@ -477,44 +479,42 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* The base implementation of `createWrapper` without `func` type checking
|
||||
* or support for setting meta data.
|
||||
* The base implementation of `createWrapper` that creates the wrapper and
|
||||
* sets its meta data.
|
||||
*
|
||||
* @private
|
||||
* @param {Function|string} func The function or method name to reference.
|
||||
* @param {number} bitmask The bitmask of method flags to compose.
|
||||
* @param {Array} [partialArgs] An array of arguments to prepend to those
|
||||
* provided to the new function.
|
||||
* @param {Array} [partialRightArgs] An array of arguments to append to those
|
||||
* provided to the new function.
|
||||
* @param {*} [thisArg] The `this` binding of `func`.
|
||||
* @param {number} [arity] The arity of `func`.
|
||||
* @param {Array} bindData The bind data array.
|
||||
* @returns {Function} Returns the new function.
|
||||
*/
|
||||
function baseCreateWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
|
||||
function baseCreateWrapper(bindData) {
|
||||
var func = bindData[0],
|
||||
bitmask = bindData[1],
|
||||
partialArgs = bindData[2],
|
||||
partialRightArgs = bindData[3],
|
||||
thisArg = bindData[4],
|
||||
arity = bindData[5];
|
||||
|
||||
var isBind = bitmask & 1,
|
||||
isBindKey = bitmask & 2,
|
||||
isCurry = bitmask & 4,
|
||||
isCurryBound = bitmask & 8,
|
||||
isPartial = bitmask & 16,
|
||||
isPartialRight = bitmask & 32,
|
||||
key = func;
|
||||
|
||||
function bound() {
|
||||
var thisBinding = isBind ? thisArg : this;
|
||||
if (isCurry || isPartial || isPartialRight) {
|
||||
if (isPartial) {
|
||||
if (isCurry || partialArgs || partialRightArgs) {
|
||||
if (partialArgs) {
|
||||
var args = partialArgs.slice();
|
||||
push.apply(args, arguments);
|
||||
}
|
||||
if (isPartialRight || isCurry) {
|
||||
if (partialRightArgs || isCurry) {
|
||||
args || (args = slice(arguments));
|
||||
if (isPartialRight) {
|
||||
if (partialRightArgs) {
|
||||
push.apply(args, partialRightArgs);
|
||||
}
|
||||
if (isCurry && args.length < arity) {
|
||||
bitmask |= 16 & ~32;
|
||||
return createWrapper(func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity);
|
||||
return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -804,11 +804,8 @@
|
||||
isPartialRight = partialRightArgs = false;
|
||||
}
|
||||
// fast path for `_.bind`
|
||||
var result = (bitmask == 1 || bitmask === 17)
|
||||
? baseBind(func, thisArg, partialArgs)
|
||||
: baseCreateWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity);
|
||||
|
||||
return result;
|
||||
var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper;
|
||||
return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user