forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ext:core/mod.js (denoland#366)
This commit adds "ext:core/mod.js" built-in ES module that reexports "core", "internals" and "primordials" properties of the "globalThis.__bootstrap" namespace. This is very convenient for embedders that author runtime code using ES modules instead of scripts, because it allows to import these props directly instead of capturing "globalThis.__bootstrap" namespace. To achieve that a new "ModuleMap::lazy_load_es_module_from_code" method was added that accepts a specifier and source code; instantiates and evaluates the provided code as ES module. This will be very useful for denoland/deno_core#263 and denoland#21422.
- Loading branch information
1 parent
4347ba6
commit 4caa187
Showing
7 changed files
with
112 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Re-export fields from `globalThis.__bootstrap` so that embedders using | ||
// ES modules can import these symbols instead of capturing the bootstrap ns. | ||
const bootstrap = globalThis.__bootstrap; | ||
const { core, internals, primordials } = bootstrap; | ||
|
||
export { core, internals, primordials }; |
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
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
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
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
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
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