diff options
Diffstat (limited to 'cli/module_loader.rs')
-rw-r--r-- | cli/module_loader.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/cli/module_loader.rs b/cli/module_loader.rs index da75b8510..aab951c4a 100644 --- a/cli/module_loader.rs +++ b/cli/module_loader.rs @@ -94,26 +94,14 @@ impl ModuleLoader for CliModuleLoader { maybe_referrer: Option<ModuleSpecifier>, _is_dynamic: bool, ) -> Pin<Box<deno_core::ModuleSourceFuture>> { - let module_specifier = module_specifier.to_owned(); - let module_url_specified = module_specifier.to_string(); + let module_specifier = module_specifier.clone(); let program_state = self.program_state.clone(); // NOTE: this block is async only because of `deno_core` // interface requirements; module was already loaded // when constructing module graph during call to `prepare_load`. - let fut = async move { - let compiled_module = program_state - .fetch_compiled_module(module_specifier, maybe_referrer)?; - Ok(deno_core::ModuleSource { - // Real module name, might be different from initial specifier - // due to redirections. - code: compiled_module.code, - module_url_specified, - module_url_found: compiled_module.name, - }) - }; - - fut.boxed_local() + async move { program_state.load(module_specifier, maybe_referrer) } + .boxed_local() } fn prepare_load( |