mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Ensure _.isEqual works more consistently with circular references.
This commit is contained in:
@@ -5230,7 +5230,7 @@
|
|||||||
}
|
}
|
||||||
// Assume cyclic values are equal.
|
// Assume cyclic values are equal.
|
||||||
var stacked = stack.get(array);
|
var stacked = stack.get(array);
|
||||||
if (stacked) {
|
if (stacked && stack.get(other)) {
|
||||||
return stacked == other;
|
return stacked == other;
|
||||||
}
|
}
|
||||||
var index = -1,
|
var index = -1,
|
||||||
@@ -5238,6 +5238,7 @@
|
|||||||
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
|
seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;
|
||||||
|
|
||||||
stack.set(array, other);
|
stack.set(array, other);
|
||||||
|
stack.set(other, array);
|
||||||
|
|
||||||
// Ignore non-index properties.
|
// Ignore non-index properties.
|
||||||
while (++index < arrLength) {
|
while (++index < arrLength) {
|
||||||
@@ -5395,11 +5396,12 @@
|
|||||||
}
|
}
|
||||||
// Assume cyclic values are equal.
|
// Assume cyclic values are equal.
|
||||||
var stacked = stack.get(object);
|
var stacked = stack.get(object);
|
||||||
if (stacked) {
|
if (stacked && stack.get(other)) {
|
||||||
return stacked == other;
|
return stacked == other;
|
||||||
}
|
}
|
||||||
var result = true;
|
var result = true;
|
||||||
stack.set(object, other);
|
stack.set(object, other);
|
||||||
|
stack.set(other, object);
|
||||||
|
|
||||||
var skipCtor = isPartial;
|
var skipCtor = isPartial;
|
||||||
while (++index < objLength) {
|
while (++index < objLength) {
|
||||||
|
|||||||
Reference in New Issue
Block a user