summaryrefslogtreecommitdiff
path: root/runtime/build.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-28 23:52:08 +0200
committerGitHub <noreply@github.com>2023-03-28 23:52:08 +0200
commitc5302a0587bfdc8a78e8edf7429772f471c47304 (patch)
treebbe82843bc2bad9bf1a86468a3413828c2f25e5e /runtime/build.rs
parent6fb6b0c1f302e8637c96131c9ffc4c4b9f3f5f0f (diff)
refactor(ext/node): change extension type parameter (#18483)
This commit changes the type parameter for "deno_node" extension, from `P: NodePermission` to `Env: NodeEnv`. `NodeEnv` is a new trait that has associated type `P: NodePermission`. This is a stepping stone to support swappable file system for the extension, that will be added as a second associated type to the `NodeEnv` trait.
Diffstat (limited to 'runtime/build.rs')
-rw-r--r--runtime/build.rs8
1 files changed, 7 insertions, 1 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(),
];