We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4991363 commit ef96fdeCopy full SHA for ef96fde
lib/assert.js
@@ -662,10 +662,11 @@ function compareBranch(
662
}
663
664
// Check for Set object equality
665
- if (actual instanceof Set && expected instanceof Set) {
+ if (isSet(actual) && isSet(expected)) {
666
if (actual.size !== expected.size) return false;
667
- for (const item of actual) {
668
- if (!expected.has(item)) return false;
+ const safeIterator = FunctionPrototypeCall(SafeSet.prototype[SymbolIterator], actual);
+ for (const item of safeIterator) {
669
+ if (!SetPrototypeHas(expected, item)) return false;
670
671
return true;
672
0 commit comments