From 9da03f529f69a91d90627ae206c29c14005f7feb Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 6 Sep 2015 21:05:05 -0700 Subject: [PATCH] Ensure `equalByTag` passing `customizer` to `equalFunc`. --- lodash.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 94acc1b20..a0e0ce059 100644 --- a/lodash.js +++ b/lodash.js @@ -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; }