Split @babel/runtime into two separate runtime modules.
This commit is contained in:
@@ -0,0 +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);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import undef from "./temporalUndefined";
|
||||
export default function _temporalRef(val, name) {
|
||||
if (val === undef) {
|
||||
throw new ReferenceError(name + " is not defined - temporal dead zone");
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
6
packages/babel-runtime-corejs2/helpers/esm/toArray.js
Normal file
6
packages/babel-runtime-corejs2/helpers/esm/toArray.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import arrayWithHoles from "./arrayWithHoles";
|
||||
import iterableToArray from "./iterableToArray";
|
||||
import nonIterableRest from "./nonIterableRest";
|
||||
export default function _toArray(arr) {
|
||||
return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest();
|
||||
}
|
||||
Reference in New Issue
Block a user