Ensure matches methods match arrays with duplicate values. [closes #2270]

This commit is contained in:
John-David Dalton
2016-04-22 22:01:29 -07:00
parent 4e38f70e0e
commit 43c26b5d6f
2 changed files with 38 additions and 4 deletions

View File

@@ -5010,10 +5010,12 @@
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (isUnordered) {
if (!arraySome(other, function(othValue) {
return arrValue === othValue ||
equalFunc(arrValue, othValue, customizer, bitmask, stack);
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!seen.has(othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
return seen.add(othIndex);
}
})) {
result = false;
break;