fix(rest-spread): Do not require Symbol.iterator for strings (#9794)
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
export default function _iterableToArray(iter) {
|
||||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
||||
if (typeof iter === 'string' || Object.prototype.toString.call(iter) === "[object Arguments]" || Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
function _iterableToArray(iter) {
|
||||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
||||
if (typeof iter === 'string' || Object.prototype.toString.call(iter) === "[object Arguments]" || Symbol.iterator in Object(iter)) return Array.from(iter);
|
||||
}
|
||||
|
||||
module.exports = _iterableToArray;
|
||||
Reference in New Issue
Block a user