diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-06-03 21:22:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-03 14:22:32 -0600 |
commit | 34dac6c6efa75f38c29031a65db1ee3332a67259 (patch) | |
tree | 5facbc9c0631feebc23ed2f2d9ea37643d0e7086 /core/extensions.rs | |
parent | 7d0853d15863b2fb61bcf5927139cfdd3d869d73 (diff) |
refactor(core): remove force_op_registration and cleanup JsRuntimeForSnapshot (#19353)
Addresses
https://github.com/denoland/deno/pull/19308#discussion_r1212248194.
Removes force_op_registration as it is no longer necessary.
Diffstat (limited to 'core/extensions.rs')
-rw-r--r-- | core/extensions.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/core/extensions.rs b/core/extensions.rs index ff86fec64..fa6d7851e 100644 --- a/core/extensions.rs +++ b/core/extensions.rs @@ -72,7 +72,6 @@ pub struct OpDecl { pub is_async: bool, pub is_unstable: bool, pub is_v8: bool, - pub force_registration: bool, pub arg_count: u8, pub fast_fn: Option<FastFunction>, } @@ -360,7 +359,6 @@ pub struct Extension { initialized: bool, enabled: bool, deps: Option<&'static [&'static str]>, - force_op_registration: bool, pub(crate) is_core: bool, } @@ -431,7 +429,6 @@ impl Extension { let mut ops = self.ops.take()?; for op in ops.iter_mut() { op.enabled = self.enabled && op.enabled; - op.force_registration = self.force_op_registration; } Some(ops) } @@ -485,7 +482,6 @@ pub struct ExtensionBuilder { event_loop_middleware: Option<Box<OpEventLoopFn>>, name: &'static str, deps: &'static [&'static str], - force_op_registration: bool, is_core: bool, } @@ -534,15 +530,6 @@ impl ExtensionBuilder { self } - /// Mark that ops from this extension should be added to `Deno.core.ops` - /// unconditionally. This is useful is some ops are not available - /// during snapshotting, as ops are not registered by default when a - /// `JsRuntime` is created with an existing snapshot. - pub fn force_op_registration(&mut self) -> &mut Self { - self.force_op_registration = true; - self - } - /// Consume the [`ExtensionBuilder`] and return an [`Extension`]. pub fn take(self) -> Extension { let js_files = Some(self.js); @@ -560,7 +547,6 @@ impl ExtensionBuilder { initialized: false, enabled: true, name: self.name, - force_op_registration: self.force_op_registration, deps, is_core: self.is_core, } @@ -583,7 +569,6 @@ impl ExtensionBuilder { enabled: true, name: self.name, deps, - force_op_registration: self.force_op_registration, is_core: self.is_core, } } |