runtime-module.js 673 B

1234567891011121314151617181920
  1. // This method of obtaining a reference to the global object needs to be
  2. // kept identical to the way it is obtained in runtime.js
  3. var g =
  4. typeof global === "object" ? global :
  5. typeof window === "object" ? window : this;
  6. var hasOwn = Object.prototype.hasOwnProperty;
  7. var hadRuntime = hasOwn.call(g, "regeneratorRuntime");
  8. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  9. delete g.regeneratorRuntime; // Force reevalutation of runtime.js.
  10. module.exports = require("./runtime");
  11. if (hadRuntime) {
  12. // Restore the original runtime.
  13. g.regeneratorRuntime = oldRuntime;
  14. } else {
  15. // Remove the global property added by runtime.js.
  16. delete g.regeneratorRuntime;
  17. }