Skip to content

Commit

Permalink
[FIXUP] Limit use of native window.Set to when Set(iterable) is suppo…
Browse files Browse the repository at this point in the history
…rted

Avoid IE11 failure, where we otherwise fail to do proper recursion checks
against cyclical JSON.

Ref #1700 (comment)
  • Loading branch information
Krinkle committed Sep 12, 2022
1 parent 7f4634f commit 6f3bd70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/globals.js
Expand Up @@ -113,7 +113,11 @@ export const StringMap = typeof g.Map === 'function' &&
}
};

export const StringSet = typeof g.Set === 'function'
// Basic fallback for ES6 Set
// Support: IE 11, `new Set(iterable)` parameter not yet implemented
// Test for Set#values() which came after Set(iterable).
export const StringSet = typeof g.Set === 'function' &&
typeof g.Set.prototype.values === 'function'
? g.Set
: function (input) {
const set = Object.create(null);
Expand Down

0 comments on commit 6f3bd70

Please sign in to comment.