2017-12-10 21:51:33 +01:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
2016-10-10 03:43:44 +02:00
|
|
|
// This method of obtaining a reference to the global object needs to be
|
|
|
|
// kept identical to the way it is obtained in runtime.js
|
2017-12-10 21:51:33 +01:00
|
|
|
var g = (function() { return this })() || Function("return this")();
|
2016-10-10 03:43:44 +02:00
|
|
|
|
|
|
|
// Use `getOwnPropertyNames` because not all browsers support calling
|
|
|
|
// `hasOwnProperty` on the global `self` object in a worker. See #183.
|
|
|
|
var hadRuntime = g.regeneratorRuntime &&
|
|
|
|
Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
|
|
|
|
|
|
|
|
// Save the old regeneratorRuntime in case it needs to be restored later.
|
|
|
|
var oldRuntime = hadRuntime && g.regeneratorRuntime;
|
|
|
|
|
|
|
|
// Force reevalutation of runtime.js.
|
|
|
|
g.regeneratorRuntime = undefined;
|
|
|
|
|
|
|
|
module.exports = require("./runtime");
|
|
|
|
|
|
|
|
if (hadRuntime) {
|
|
|
|
// Restore the original runtime.
|
|
|
|
g.regeneratorRuntime = oldRuntime;
|
|
|
|
} else {
|
|
|
|
// Remove the global property added by runtime.js.
|
|
|
|
try {
|
|
|
|
delete g.regeneratorRuntime;
|
|
|
|
} catch(e) {
|
|
|
|
g.regeneratorRuntime = undefined;
|
|
|
|
}
|
|
|
|
}
|