diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-06-24 10:04:45 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 15:04:45 +0200 |
commit | fd5a12d7e25dc53238e2bbcffe970e646c1035f3 (patch) | |
tree | 251c3ec1a46067b02ef30fb48349962973016bf3 /runtime/web_worker.rs | |
parent | d39094913e91e5193f63459d9c5ca6ddc7779477 (diff) |
refactor(snapshots): to their own crate (#14794)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r-- | runtime/web_worker.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index ba2c016cc..19e344ee7 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -335,6 +335,7 @@ pub struct WebWorkerOptions { 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 WebWorker { @@ -427,6 +428,8 @@ impl WebWorker { ops::tty::init(), deno_http::init(), ops::http::init(), + // Runtime JS + js::init(), // Permissions ext (worker specific state) perm_ext, ]; @@ -436,7 +439,7 @@ impl WebWorker { 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(), |