Ensure _.isEqual works more consistently with circular references.

This commit is contained in:
John-David Dalton
2016-07-02 10:19:15 -07:00
parent 4fb4ec5328
commit a8d3689061

View File

@@ -5230,7 +5230,7 @@
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked) {
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
@@ -5238,6 +5238,7 @@
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
@@ -5395,11 +5396,12 @@
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {