fix(rest-spread): Do not require Symbol.iterator for strings (#9794)

This commit is contained in:
Carlos Lopez
2020-03-15 09:54:44 -04:00
committed by GitHub
parent 661ffbd830
commit 7b9bc7c28b
8 changed files with 22 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import _Array$from from "../../core-js/array/from";
import _isIterable from "../../core-js/is-iterable";
export default function _iterableToArray(iter) {
if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter);
if (typeof iter === 'string' || Object.prototype.toString.call(iter) === "[object Arguments]" || _isIterable(Object(iter))) return _Array$from(iter);
}

View File

@@ -3,7 +3,7 @@ var _Array$from = require("../core-js/array/from");
var _isIterable = require("../core-js/is-iterable");
function _iterableToArray(iter) {
if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter);
if (typeof iter === 'string' || Object.prototype.toString.call(iter) === "[object Arguments]" || _isIterable(Object(iter))) return _Array$from(iter);
}
module.exports = _iterableToArray;