Split @babel/runtime into two separate runtime modules.

This commit is contained in:
Logan Smyth
2018-06-24 10:50:26 -07:00
parent 3210a7a873
commit a8224d40e2
74 changed files with 382 additions and 122 deletions

View File

@@ -0,0 +1,3 @@
export default function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}

View File

@@ -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;
}
}

View 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();
}