mirror of
https://github.com/denoland/deno.git
synced 2025-10-01 22:51:14 +00:00
RecursiveLoad shouldn't own the Isolate (#2453)
This patch makes it so that RecursiveLoad doesn't own the Isolate, so Worker::execute_mod_async does not consume itself. Previously Worker implemented Loader, but now ThreadSafeState does. This is necessary preparation work for dynamic import (#1789) and import maps (#1921)
This commit is contained in:
parent
6fa4d2e759
commit
e152dae006
5 changed files with 251 additions and 249 deletions
|
@ -2067,7 +2067,7 @@ fn op_create_worker(
|
|||
// TODO(ry) Use execute_mod_async here.
|
||||
let result = worker.execute_mod(&specifier_url, false);
|
||||
match result {
|
||||
Ok(worker) => {
|
||||
Ok(()) => {
|
||||
let mut workers_tl = parent_state.workers.lock().unwrap();
|
||||
workers_tl.insert(rid, worker.shared());
|
||||
let builder = &mut FlatBufferBuilder::new();
|
||||
|
@ -2085,10 +2085,8 @@ fn op_create_worker(
|
|||
},
|
||||
))
|
||||
}
|
||||
Err((errors::RustOrJsError::Js(_), _worker)) => {
|
||||
Err(errors::worker_init_failed())
|
||||
}
|
||||
Err((errors::RustOrJsError::Rust(err), _worker)) => Err(err),
|
||||
Err(errors::RustOrJsError::Js(_)) => Err(errors::worker_init_failed()),
|
||||
Err(errors::RustOrJsError::Rust(err)) => Err(err),
|
||||
}
|
||||
}()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue