Fix helpers.unsupportedIterableToArray for Map and Set (#11495)

Fixes #11494
This commit is contained in:
Chintan Acharya
2020-04-28 10:57:03 +05:30
committed by GitHub
parent 1b777f5266
commit 93429f8b09
5 changed files with 5 additions and 5 deletions

View File

@@ -1044,7 +1044,7 @@ helpers.unsupportedIterableToArray = helper("7.9.0")`
if (typeof o === "string") return arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return arrayLikeToArray(o, minLen);
}