Support iterating generators in browsers without Symbol (#13129)

This commit is contained in:
Nicolò Ribaudo
2021-04-15 23:47:53 +02:00
committed by GitHub
parent 5d55055537
commit 808d437cf4
15 changed files with 123 additions and 52 deletions

View File

@@ -1,6 +1,6 @@
import _Symbol from "@babel/runtime-corejs2/core-js/symbol";
import _isIterable from "@babel/runtime-corejs2/core-js/is-iterable";
import _Symbol$iterator from "@babel/runtime-corejs2/core-js/symbol/iterator";
import _Array$from from "@babel/runtime-corejs2/core-js/array/from";
export default function _iterableToArray(iter) {
if (typeof _Symbol !== "undefined" && _isIterable(Object(iter))) return _Array$from(iter);
if (typeof _Symbol !== "undefined" && iter[_Symbol$iterator] != null || iter["@@iterator"] != null) return _Array$from(iter);
}

View File

@@ -1,11 +1,11 @@
var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
var _isIterable = require("@babel/runtime-corejs2/core-js/is-iterable");
var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
function _iterableToArray(iter) {
if (typeof _Symbol !== "undefined" && _isIterable(Object(iter))) return _Array$from(iter);
if (typeof _Symbol !== "undefined" && iter[_Symbol$iterator] != null || iter["@@iterator"] != null) return _Array$from(iter);
}
module.exports = _iterableToArray;