diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-06-19 15:14:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-19 16:14:43 +0200 |
commit | 2ea41d3ac159e4c2e998d13412dc19680b01a6ca (patch) | |
tree | c771d33f481c1bbc1b82f758ec96bfa5c342389c /cli/tests/single_compile_with_reload.ts | |
parent | b0c04a7941bb1bab0f135c39d484ac47dae14300 (diff) |
fix(core/modules): Prepare modules only once per runtime (#11015)
This commit changes module loading implementation in "deno_core"
to call "ModuleLoader::prepare" hook only once per entry point.
This is done to avoid multiple type checking of the same code
in case of duplicated dynamic imports.
Relevant code in "cli/module_graph.rs" was updated as well.
Diffstat (limited to 'cli/tests/single_compile_with_reload.ts')
-rw-r--r-- | cli/tests/single_compile_with_reload.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/single_compile_with_reload.ts b/cli/tests/single_compile_with_reload.ts index a4d6d0341..f84e91f2f 100644 --- a/cli/tests/single_compile_with_reload.ts +++ b/cli/tests/single_compile_with_reload.ts @@ -2,3 +2,17 @@ await import("./single_compile_with_reload_dyn.ts"); console.log("1"); await import("./single_compile_with_reload_dyn.ts"); console.log("2"); +await new Promise((r) => + new Worker( + new URL("single_compile_with_reload_worker.ts", import.meta.url).href, + { type: "module" }, + ).onmessage = r +); +console.log("3"); +await new Promise((r) => + new Worker( + new URL("single_compile_with_reload_worker.ts", import.meta.url).href, + { type: "module" }, + ).onmessage = r +); +console.log("4"); |