mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
refactor: module loading in EsIsolate (#3615)
* refactored RecursiveLoad - it was renamed to RecursiveModuleLoad, it does not take ownership of isolate anymore - a struct implementing Stream that yields SourceCodeInfo * untangled module loading logic between RecursiveLoad and isolate - that logic is encapsulated in EsIsolate and RecursiveModuleLoad, where isolate just consumes modules as they become available - does not require to pass Arc<Mutex<Isolate>> around anymore * removed EsIsolate.mods_ in favor of Modules and moved them inside EsIsolate * EsIsolate now requires "loader" argument during construction - struct that implements Loader trait * rewrite first methods on isolate as async
This commit is contained in:
parent
8466460311
commit
cbdf9c5009
7 changed files with 693 additions and 888 deletions
|
@ -172,7 +172,6 @@ fn print_cache_info(worker: Worker) {
|
|||
|
||||
async fn print_file_info(worker: Worker, module_specifier: ModuleSpecifier) {
|
||||
let global_state_ = &worker.state.global_state;
|
||||
let state_ = &worker.state;
|
||||
|
||||
let maybe_source_file = global_state_
|
||||
.file_fetcher
|
||||
|
@ -233,7 +232,8 @@ async fn print_file_info(worker: Worker, module_specifier: ModuleSpecifier) {
|
|||
);
|
||||
}
|
||||
|
||||
if let Some(deps) = state_.modules.lock().unwrap().deps(&compiled.name) {
|
||||
let isolate = worker.isolate.try_lock().unwrap();
|
||||
if let Some(deps) = isolate.modules.deps(&compiled.name) {
|
||||
println!("{}{}", colors::bold("deps:\n".to_string()), deps.name);
|
||||
if let Some(ref depsdeps) = deps.deps {
|
||||
for d in depsdeps {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue