summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2023-05-04 14:36:38 +0200
committerGitHub <noreply@github.com>2023-05-04 14:36:38 +0200
commit95e209a0e4ef0e4a0b886583057b84ef204261d3 (patch)
treefe7bc059375068e0ec9ab8b7858ac62cb888c177 /runtime
parentb8d0e616eaedb81a759c41d5009921bcc6b0b0bf (diff)
refactor(ext/node): remove NodeEnv trait (#18986)
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, 3 insertions, 14 deletions
diff --git a/runtime/build.rs b/runtime/build.rs
index 2f3b12595..bba2eae55 100644
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -215,12 +215,6 @@ mod startup_snapshot {
}
}
- struct SnapshotNodeEnv;
-
- impl deno_node::NodeEnv for SnapshotNodeEnv {
- type P = Permissions;
- }
-
deno_core::extension!(runtime,
deps = [
deno_webidl,
@@ -320,7 +314,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::<SnapshotNodeEnv>(None, None),
+ deno_node::deno_node::init_ops_and_esm::<Permissions>(None, None),
#[cfg(not(feature = "snapshot_from_snapshot"))]
runtime_main::init_ops_and_esm(),
];
diff --git a/runtime/lib.rs b/runtime/lib.rs
index 878171913..50822d373 100644
--- a/runtime/lib.rs
+++ b/runtime/lib.rs
@@ -35,8 +35,3 @@ 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 b688aae8b..1b3dd2809 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -442,7 +442,7 @@ impl WebWorker {
deno_http::deno_http::init_ops(),
deno_io::deno_io::init_ops(Some(options.stdio)),
deno_fs::deno_fs::init_ops::<_, PermissionsContainer>(unstable, StdFs),
- deno_node::deno_node::init_ops::<crate::RuntimeNodeEnv>(
+ deno_node::deno_node::init_ops::<PermissionsContainer>(
options.npm_resolver,
options.node_fs,
),
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 0d68a4b51..ac67011f0 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -267,7 +267,7 @@ impl MainWorker {
deno_http::deno_http::init_ops(),
deno_io::deno_io::init_ops(Some(options.stdio)),
deno_fs::deno_fs::init_ops::<_, PermissionsContainer>(unstable, StdFs),
- deno_node::deno_node::init_ops::<crate::RuntimeNodeEnv>(
+ deno_node::deno_node::init_ops::<PermissionsContainer>(
options.npm_resolver,
options.node_fs,
),