Cleanup _.xor patch and add a unit test.

This commit is contained in:
John-David Dalton
2013-12-06 20:34:59 -08:00
parent 64fc924357
commit 51698944e0
9 changed files with 92 additions and 81 deletions

7
dist/lodash.js vendored
View File

@@ -4134,12 +4134,13 @@
function compact(array) {
var index = -1,
length = array ? array.length : 0,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result.push(value);
result[resIndex++] = value;
}
}
return result;
@@ -5075,11 +5076,11 @@
var array = arguments[index];
if (isArray(array) || isArguments(array)) {
var result = result
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
? baseDifference(result, array).concat(baseDifference(array, result))
: array;
}
}
return result || [];
return result ? baseUniq(result) : [];
}
/**