summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/build.rs8
-rw-r--r--runtime/lib.rs5
-rw-r--r--runtime/web_worker.rs2
-rw-r--r--runtime/worker.rs2
4 files changed, 14 insertions, 3 deletions
diff --git a/runtime/build.rs b/runtime/build.rs
index df20c5427..dac6dee88 100644
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -218,6 +218,12 @@ mod startup_snapshot {
}
}
+ struct SnapshotNodeEnv;
+
+ impl deno_node::NodeEnv for SnapshotNodeEnv {
+ type P = Permissions;
+ }
+
deno_core::extension!(runtime,
deps = [
deno_webidl,
@@ -319,7 +325,7 @@ mod startup_snapshot {
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),
+ deno_node::deno_node::init_ops_and_esm::<SnapshotNodeEnv>(None),
#[cfg(not(feature = "snapshot_from_snapshot"))]
runtime_main::init_ops_and_esm(),
];
diff --git a/runtime/lib.rs b/runtime/lib.rs
index 02d52cd5a..57108aa7e 100644
--- a/runtime/lib.rs
+++ b/runtime/lib.rs
@@ -36,3 +36,8 @@ pub mod worker;
mod worker_bootstrap;
pub use worker_bootstrap::BootstrapOptions;
+
+pub struct RuntimeNodeEnv;
+impl deno_node::NodeEnv for RuntimeNodeEnv {
+ type P = permissions::PermissionsContainer;
+}
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index b50e91610..399b22912 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -441,7 +441,7 @@ impl WebWorker {
deno_io::deno_io::init_ops(Some(options.stdio)),
deno_fs::deno_fs::init_ops::<PermissionsContainer>(unstable),
deno_flash::deno_flash::init_ops::<PermissionsContainer>(unstable),
- deno_node::deno_node::init_ops::<PermissionsContainer>(
+ deno_node::deno_node::init_ops::<crate::RuntimeNodeEnv>(
options.npm_resolver,
),
// Runtime ops that are always initialized for WebWorkers
diff --git a/runtime/worker.rs b/runtime/worker.rs
index a8fd6b1da..296e9c4b1 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -265,7 +265,7 @@ impl MainWorker {
deno_io::deno_io::init_ops(Some(options.stdio)),
deno_fs::deno_fs::init_ops::<PermissionsContainer>(unstable),
deno_flash::deno_flash::init_ops::<PermissionsContainer>(unstable),
- deno_node::deno_node::init_ops::<PermissionsContainer>(
+ deno_node::deno_node::init_ops::<crate::RuntimeNodeEnv>(
options.npm_resolver,
),
// Ops from this crate