Fix builds.

This commit is contained in:
John-David Dalton
2013-11-07 20:48:11 -08:00
parent 5faa0f55bc
commit fc3ff34c2d
2 changed files with 41 additions and 116 deletions

71
dist/lodash.compat.js vendored
View File

@@ -1232,6 +1232,43 @@
return bound;
}
/**
* The base implementation of `_.difference` that accepts a single array
* of values to exclude.
*
* @private
* @param {Array} array The array to process.
* @param {Array} [values] The array of values to exclude.
* @returns {Array} Returns a new array of filtered values.
*/
function baseDifference(array, values) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
isLarge = length >= largeArraySize && indexOf === baseIndexOf,
result = [];
if (isLarge) {
var cache = createCache(values);
if (cache) {
indexOf = cacheIndexOf;
values = cache;
} else {
isLarge = false;
}
}
while (++index < length) {
var value = array[index];
if (indexOf(values, value) < 0) {
result.push(value);
}
}
if (isLarge) {
releaseObject(values);
}
return result;
}
/**
* The base implementation of `_.flatten` without support for callback
* shorthands or `thisArg` binding.
@@ -2977,7 +3014,7 @@
forIn(object, function(value, key) {
props.push(key);
});
props = difference(props, baseFlatten(arguments, true, false, 1));
props = baseDifference(props, baseFlatten(arguments, true, false, 1));
var index = -1,
length = props.length;
@@ -4356,7 +4393,7 @@
* @memberOf _
* @category Arrays
* @param {Array} array The array to process.
* @param {...Array} [array] The arrays of values to exclude.
* @param {...Array} [values] The arrays of values to exclude.
* @returns {Array} Returns a new array of filtered values.
* @example
*
@@ -4364,33 +4401,7 @@
* // => [1, 3, 4]
*/
function difference(array) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
seen = baseFlatten(arguments, true, true, 1),
result = [];
var isLarge = length >= largeArraySize && indexOf === baseIndexOf;
if (isLarge) {
var cache = createCache(seen);
if (cache) {
indexOf = cacheIndexOf;
seen = cache;
} else {
isLarge = false;
}
}
while (++index < length) {
var value = array[index];
if (indexOf(seen, value) < 0) {
result.push(value);
}
}
if (isLarge) {
releaseObject(seen);
}
return result;
return baseDifference(array, baseFlatten(arguments, true, true, 1));
}
/**
@@ -5254,7 +5265,7 @@
* // => [2, 3, 4]
*/
function without(array) {
return difference(array, slice(arguments, 1));
return baseDifference(array, slice(arguments, 1));
}
/**