diff options
Diffstat (limited to 'cli/worker.rs')
-rw-r--r-- | cli/worker.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/worker.rs b/cli/worker.rs index 5a4299214..a7bc7bb7a 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -162,7 +162,10 @@ impl Loader for Worker { } /// Given an absolute url, load its source code. - fn load(&mut self, url: &str) -> Box<deno::SourceCodeFuture<Self::Error>> { + fn load( + &mut self, + url: &str, + ) -> Box<deno::SourceCodeInfoFuture<Self::Error>> { self .state .metrics @@ -173,7 +176,12 @@ impl Loader for Worker { .map_err(|err| { eprintln!("{}", err); err - }).map(|module_meta_data| module_meta_data.js_source()), + }).map(|module_meta_data| deno::SourceCodeInfo { + // Real module name, might be different from initial URL + // due to redirections. + code: module_meta_data.js_source(), + module_name: module_meta_data.module_name, + }), ) } |