Ensure _.isEqual performs comparisons between objects with shared property values correctly. [closes #415]

This commit is contained in:
John-David Dalton
2013-12-02 21:14:12 -08:00
parent 9e42f70e5f
commit c319bbc5f3
8 changed files with 146 additions and 132 deletions

View File

@@ -690,22 +690,25 @@
}
}
}
return result;
}
forIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
size++;
return !(result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, stackA, stackB)) && indicatorObject;
}
});
if (result) {
forIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
return !(result = --size > -1) && indicatorObject;
else {
forIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
size++;
return !(result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, stackA, stackB)) && indicatorObject;
}
});
if (result) {
forIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
return !(result = --size > -1) && indicatorObject;
}
});
}
}
stackA.pop();
stackB.pop();
return result;
}