diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/build.rs | 8 | ||||
-rw-r--r-- | runtime/web_worker.rs | 8 | ||||
-rw-r--r-- | runtime/worker.rs | 9 |
3 files changed, 13 insertions, 12 deletions
diff --git a/runtime/build.rs b/runtime/build.rs index d096df7db..4f49ba681 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -273,6 +273,7 @@ mod startup_snapshot { pub fn create_runtime_snapshot(snapshot_path: PathBuf) { // NOTE(bartlomieju): ordering is important here, keep it in sync with // `runtime/worker.rs`, `runtime/web_worker.rs` and `cli/build.rs`! + let fs = std::sync::Arc::new(deno_fs::RealFs); let extensions: Vec<Extension> = vec![ deno_webidl::deno_webidl::init_ops_and_esm(), deno_console::deno_console::init_ops_and_esm(), @@ -309,14 +310,11 @@ mod startup_snapshot { deno_napi::deno_napi::init_ops_and_esm::<Permissions>(), deno_http::deno_http::init_ops_and_esm(), deno_io::deno_io::init_ops_and_esm(Default::default()), - deno_fs::deno_fs::init_ops_and_esm::<Permissions>( - false, - std::sync::Arc::new(deno_fs::RealFs), - ), + deno_fs::deno_fs::init_ops_and_esm::<Permissions>(false, fs.clone()), runtime::init_ops_and_esm(), // FIXME(bartlomieju): these extensions are specified last, because they // depend on `runtime`, even though it should be other way around - deno_node::deno_node::init_ops_and_esm::<Permissions>(None, None), + deno_node::deno_node::init_ops_and_esm::<Permissions>(None, fs), #[cfg(not(feature = "snapshot_from_snapshot"))] runtime_main::init_ops_and_esm(), ]; diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index e485c0c35..6487239f8 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -333,7 +333,6 @@ pub struct WebWorkerOptions { pub seed: Option<u64>, pub fs: Arc<dyn FileSystem>, pub module_loader: Rc<dyn ModuleLoader>, - pub node_fs: Option<Arc<dyn deno_node::NodeFs>>, pub npm_resolver: Option<Arc<dyn deno_node::NpmResolver>>, pub create_web_worker_cb: Arc<ops::worker_host::CreateWebWorkerCb>, pub preload_module_cb: Arc<ops::worker_host::WorkerEventCb>, @@ -442,10 +441,13 @@ impl WebWorker { deno_napi::deno_napi::init_ops::<PermissionsContainer>(), deno_http::deno_http::init_ops(), deno_io::deno_io::init_ops(Some(options.stdio)), - deno_fs::deno_fs::init_ops::<PermissionsContainer>(unstable, options.fs), + deno_fs::deno_fs::init_ops::<PermissionsContainer>( + unstable, + options.fs.clone(), + ), deno_node::deno_node::init_ops::<PermissionsContainer>( options.npm_resolver, - options.node_fs, + options.fs, ), // Runtime ops that are always initialized for WebWorkers ops::web_worker::deno_web_worker::init_ops(), diff --git a/runtime/worker.rs b/runtime/worker.rs index b9db21780..77f16553b 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -94,7 +94,6 @@ pub struct WorkerOptions { /// If not provided runtime will error if code being /// executed tries to load modules. pub module_loader: Rc<dyn ModuleLoader>, - pub node_fs: Option<Arc<dyn deno_node::NodeFs>>, pub npm_resolver: Option<Arc<dyn deno_node::NpmResolver>>, // Callbacks invoked when creating new instance of WebWorker pub create_web_worker_cb: Arc<ops::worker_host::CreateWebWorkerCb>, @@ -166,7 +165,6 @@ impl Default for WorkerOptions { broadcast_channel: Default::default(), source_map_getter: Default::default(), root_cert_store_provider: Default::default(), - node_fs: Default::default(), npm_resolver: Default::default(), blob_store: Default::default(), extensions: Default::default(), @@ -268,10 +266,13 @@ impl MainWorker { deno_napi::deno_napi::init_ops::<PermissionsContainer>(), deno_http::deno_http::init_ops(), deno_io::deno_io::init_ops(Some(options.stdio)), - deno_fs::deno_fs::init_ops::<PermissionsContainer>(unstable, options.fs), + deno_fs::deno_fs::init_ops::<PermissionsContainer>( + unstable, + options.fs.clone(), + ), deno_node::deno_node::init_ops::<PermissionsContainer>( options.npm_resolver, - options.node_fs, + options.fs, ), // Ops from this crate ops::runtime::deno_runtime::init_ops(main_module.clone()), |