Merge pull request #11598 from Snuffleupagus/polyfill-Map-Set-iteration

Add polyfills to support iteration of `Map` and `Set`
This commit is contained in:
Tim van der Meij 2020-02-14 23:24:20 +01:00 committed by GitHub
commit f6ffc2bf37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,6 +283,26 @@ if (
globalThis.ReadableStream = require("web-streams-polyfill/dist/ponyfill.js").ReadableStream;
})();
// We want to support Map iteration, but it doesn't seem possible to easily
// test for that specifically; hence using a similarly unsupported property.
// Support: IE11
(function checkMapEntries() {
if (globalThis.Map && globalThis.Map.prototype.entries) {
return;
}
globalThis.Map = require("core-js/es/map/index.js");
})();
// We want to support Set iteration, but it doesn't seem possible to easily
// test for that specifically; hence using a similarly unsupported property.
// Support: IE11
(function checkSetEntries() {
if (globalThis.Set && globalThis.Set.prototype.entries) {
return;
}
globalThis.Set = require("core-js/es/set/index.js");
})();
// Support: IE<11, Safari<8, Chrome<36
(function checkWeakMap() {
if (globalThis.WeakMap) {