Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define the global
regeneratorRuntime
in @babel/runtime/regenerator
(
- Loading branch information
1 parent
dd42951
commit 52a9089
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
module.exports = require("../helpers/regeneratorRuntime")(); | ||
// TODO(Babel 8): Remove this file. | ||
|
||
const runtime = require("../helpers/regeneratorRuntime")(); | ||
module.exports = runtime; | ||
|
||
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | ||
try { | ||
regeneratorRuntime = runtime; | ||
} catch (accidentalStrictMode) { | ||
if (typeof globalThis === "object") { | ||
globalThis.regeneratorRuntime = runtime; | ||
} else { | ||
Function("r", "regeneratorRuntime = r")(runtime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
module.exports = require("../helpers/regeneratorRuntime")(); | ||
// TODO(Babel 8): Remove this file. | ||
|
||
const runtime = require("../helpers/regeneratorRuntime")(); | ||
module.exports = runtime; | ||
|
||
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | ||
try { | ||
regeneratorRuntime = runtime; | ||
} catch (accidentalStrictMode) { | ||
if (typeof globalThis === "object") { | ||
globalThis.regeneratorRuntime = runtime; | ||
} else { | ||
Function("r", "regeneratorRuntime = r")(runtime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
module.exports = require("../helpers/regeneratorRuntime")(); | ||
// TODO(Babel 8): Remove this file. | ||
|
||
const runtime = require("../helpers/regeneratorRuntime")(); | ||
module.exports = runtime; | ||
|
||
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | ||
try { | ||
regeneratorRuntime = runtime; | ||
} catch (accidentalStrictMode) { | ||
if (typeof globalThis === "object") { | ||
globalThis.regeneratorRuntime = runtime; | ||
} else { | ||
Function("r", "regeneratorRuntime = r")(runtime); | ||
} | ||
} |