(a, b, mode, memo)
| 740 | } |
| 741 | |
| 742 | function setEquiv(a, b, mode, memo) { |
| 743 | // This is a lazily initiated Set of entries which have to be compared |
| 744 | // pairwise. |
| 745 | let array; |
| 746 | |
| 747 | const iteratorB = b.values(); |
| 748 | for (const val of iteratorB) { |
| 749 | if (!a.has(val)) { |
| 750 | if ((typeof val !== 'object' || val === null) && |
| 751 | (mode !== kLoose || !setMightHaveLoosePrim(a, b, val))) { |
| 752 | return false; |
| 753 | } |
| 754 | |
| 755 | if (array === undefined) { |
| 756 | if (a.size < 3) { |
| 757 | return compareSmallSets(a, b, val, iteratorB, mode, memo); |
| 758 | } |
| 759 | array = []; |
| 760 | } |
| 761 | // If the specified value doesn't exist in the second set it's a object |
| 762 | // (or in loose mode: a non-matching primitive). Find the |
| 763 | // deep-(mode-)equal element in a set copy to reduce duplicate checks. |
| 764 | array.push(val); |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | if (array === undefined) { |
| 769 | return true; |
| 770 | } |
| 771 | if (mode === kPartial) { |
| 772 | return partialObjectSetEquiv(array, a, b, mode, memo); |
| 773 | } |
| 774 | return setObjectEquiv(array, a, b, mode, memo); |
| 775 | } |
| 776 | |
| 777 | function partialObjectMapEquiv(array, a, b, mode, memo) { |
| 778 | let aPos = 0; |
no test coverage detected
searching dependent graphs…