Remove placeholder support from non-underscore builds.

This commit is contained in:
John-David Dalton
2014-02-15 13:39:03 -08:00
parent fdbfe0f84b
commit 3d311496e0
5 changed files with 114 additions and 155 deletions

26
dist/lodash.compat.js vendored
View File

@@ -1919,7 +1919,7 @@
* @param {Array} [partialRightArgs] An array of arguments to append to those
* provided to the new function.
* @param {Array} [partialHolders] An array of `partialArgs` placeholder indexes.
* @param {Array} [partialRightArgs] An array of `partialRightArgs` placeholder indexes.
* @param {Array} [partialRightHolders] An array of `partialRightArgs` placeholder indexes.
* @returns {Function} Returns the new function.
*/
function createWrapper(func, bitmask, arity, thisArg, partialArgs, partialRightArgs, partialHolders, partialRightHolders) {
@@ -1991,10 +1991,10 @@
arity = 0;
}
if (isPartial) {
partialHolders = getHolders(partialArgs);
partialHolders = [];
}
if (isPartialRight) {
partialRightHolders = getHolders(partialRightArgs);
partialRightHolders = [];
}
// fast path for `_.bind`
data = [func, bitmask, arity, thisArg, partialArgs, partialRightArgs, partialHolders, partialRightHolders];
@@ -2031,26 +2031,6 @@
);
}
/**
* Finds the indexes of all placeholder elements in a given array.
*
* @private
* @param {Array} array The array to inspect.
* @returns {Array} Returns a new array of placeholder indexes.
*/
function getHolders(array) {
var index = -1,
length = array.length,
result = [];
while (++index < length) {
if (array[index] === lodash) {
result.push(index);
}
}
return result;
}
/**
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
* customized this method returns the custom method, otherwise it returns