diff options
Diffstat (limited to 'runtime/worker.rs')
| -rw-r--r-- | runtime/worker.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs index e46b5c75f..acb50dc30 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -81,6 +81,7 @@ pub struct WorkerOptions { pub shared_array_buffer_store: Option<SharedArrayBufferStore>, pub compiled_wasm_module_store: Option<CompiledWasmModuleStore>, pub stdio: Stdio, + pub startup_snapshot: Option<deno_core::Snapshot>, } impl MainWorker { @@ -168,6 +169,8 @@ impl MainWorker { ops::tty::init(), deno_http::init(), ops::http::init(), + // Runtime JS + js::init(), // Permissions ext (worker specific state) perm_ext, ]; @@ -175,7 +178,7 @@ impl MainWorker { let mut js_runtime = JsRuntime::new(RuntimeOptions { module_loader: Some(options.module_loader.clone()), - startup_snapshot: Some(js::deno_isolate_init()), + startup_snapshot: options.startup_snapshot.take(), source_map_getter: options.source_map_getter, get_error_class_fn: options.get_error_class_fn, shared_array_buffer_store: options.shared_array_buffer_store.clone(), @@ -411,6 +414,7 @@ mod tests { shared_array_buffer_store: None, compiled_wasm_module_store: None, stdio: Default::default(), + startup_snapshot: None, }; MainWorker::bootstrap_from_options(main_module, permissions, options) |
