Add support for comparing symbol properties to _.isEqual. [closes #2840]

This commit is contained in:
John-David Dalton
2016-11-20 16:00:07 -06:00
parent 86ee93650d
commit a3e077324a
2 changed files with 80 additions and 58 deletions

View File

@@ -3304,16 +3304,16 @@
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = arrayTag,
othTag = arrayTag;
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
if (!objIsArr) {
objTag = getTag(object);
objTag = objTag == argsTag ? objectTag : objTag;
if (objTag == argsTag) {
objTag = objectTag;
object = copyObject(object, keys(object));
}
if (!othIsArr) {
othTag = getTag(other);
othTag = othTag == argsTag ? objectTag : othTag;
if (othTag == argsTag) {
othTag = objectTag;
other = copyObject(other, keys(other));
}
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
@@ -5816,9 +5816,9 @@
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = keys(object),
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = keys(other),
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {