Ensure equalByTag passing customizer to equalFunc.

This commit is contained in:
John-David Dalton
2015-09-06 21:05:05 -07:00
parent 1e1e4fd557
commit 9da03f529f

View File

@@ -2308,7 +2308,7 @@
isSameTag = objTag == othTag;
if (isSameTag && !(objIsArr || objIsObj)) {
return equalByTag(object, other, objTag, equalFunc, bitmask);
return equalByTag(object, other, objTag, equalFunc, customizer, bitmask);
}
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
if (!isPartial) {
@@ -3757,10 +3757,11 @@
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Function} [customizer] The function to customize comparisons.
* @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, equalFunc, bitmask) {
function equalByTag(object, other, tag, equalFunc, customizer, bitmask) {
switch (tag) {
case boolTag:
case dateTag:
@@ -3789,8 +3790,10 @@
case setTag:
var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
convert || (convert = setToArray);
// Recursively compare objects (susceptible to call stack limits).
return (isPartial || object.size == other.size) &&
equalFunc(convert(object), convert(other), undefined, bitmask | UNORDERED_COMPARE_FLAG);
equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG);
}
return false;
}