summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-06-03 21:22:32 +0100
committerGitHub <noreply@github.com>2023-06-03 14:22:32 -0600
commit34dac6c6efa75f38c29031a65db1ee3332a67259 (patch)
tree5facbc9c0631feebc23ed2f2d9ea37643d0e7086 /runtime
parent7d0853d15863b2fb61bcf5927139cfdd3d869d73 (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 'runtime')
-rw-r--r--runtime/examples/extension_with_ops/main.rs8
-rw-r--r--runtime/ops/fs_events.rs3
-rw-r--r--runtime/ops/http.rs3
-rw-r--r--runtime/ops/os/mod.rs6
-rw-r--r--runtime/ops/permissions.rs3
-rw-r--r--runtime/ops/process.rs3
-rw-r--r--runtime/ops/runtime.rs3
-rw-r--r--runtime/ops/signal.rs3
-rw-r--r--runtime/ops/tty.rs3
-rw-r--r--runtime/ops/web_worker.rs3
-rw-r--r--runtime/ops/worker_host.rs3
11 files changed, 1 insertions, 40 deletions
diff --git a/runtime/examples/extension_with_ops/main.rs b/runtime/examples/extension_with_ops/main.rs
index 47feaeaeb..1feb4ba27 100644
--- a/runtime/examples/extension_with_ops/main.rs
+++ b/runtime/examples/extension_with_ops/main.rs
@@ -11,13 +11,7 @@ use deno_runtime::permissions::PermissionsContainer;
use deno_runtime::worker::MainWorker;
use deno_runtime::worker::WorkerOptions;
-deno_core::extension!(
- hello_runtime,
- ops = [op_hello],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
-);
+deno_core::extension!(hello_runtime, ops = [op_hello]);
#[op]
fn op_hello(text: &str) {
diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs
index 27e76b3d3..2668431eb 100644
--- a/runtime/ops/fs_events.rs
+++ b/runtime/ops/fs_events.rs
@@ -31,9 +31,6 @@ use tokio::sync::mpsc;
deno_core::extension!(
deno_fs_events,
ops = [op_fs_events_open, op_fs_events_poll],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
struct FsEventsResource {
diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs
index 767fc3ae0..eb2711257 100644
--- a/runtime/ops/http.rs
+++ b/runtime/ops/http.rs
@@ -30,9 +30,6 @@ use tokio::net::UnixStream;
deno_core::extension!(
deno_http_runtime,
ops = [op_http_start, op_http_upgrade],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
#[op]
diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs
index b997a89d9..043dec700 100644
--- a/runtime/ops/os/mod.rs
+++ b/runtime/ops/os/mod.rs
@@ -48,9 +48,6 @@ deno_core::extension!(
state = |state, options| {
state.put::<ExitCode>(options.exit_code);
},
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- }
);
deno_core::extension!(
@@ -63,9 +60,6 @@ deno_core::extension!(
},
_ => op,
},
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- }
);
#[op]
diff --git a/runtime/ops/permissions.rs b/runtime/ops/permissions.rs
index 6f7b98a30..663b1d240 100644
--- a/runtime/ops/permissions.rs
+++ b/runtime/ops/permissions.rs
@@ -18,9 +18,6 @@ deno_core::extension!(
op_revoke_permission,
op_request_permission,
],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
#[derive(Deserialize)]
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs
index a2eace8b6..44429fdab 100644
--- a/runtime/ops/process.rs
+++ b/runtime/ops/process.rs
@@ -112,9 +112,6 @@ deno_core::extension!(
deprecated::op_run_status,
deprecated::op_kill,
],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
/// Second member stores the pid separately from the RefCell. It's needed for
diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs
index 9f2e48d7a..3f60c7437 100644
--- a/runtime/ops/runtime.rs
+++ b/runtime/ops/runtime.rs
@@ -13,9 +13,6 @@ deno_core::extension!(
state = |state, options| {
state.put::<ModuleSpecifier>(options.main_module);
},
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
#[op]
diff --git a/runtime/ops/signal.rs b/runtime/ops/signal.rs
index ba9a2a178..934192c77 100644
--- a/runtime/ops/signal.rs
+++ b/runtime/ops/signal.rs
@@ -32,9 +32,6 @@ use tokio::signal::windows::CtrlC;
deno_core::extension!(
deno_signal,
ops = [op_signal_bind, op_signal_unbind, op_signal_poll],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
#[cfg(unix)]
diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs
index 7f24daec4..b4e4d7340 100644
--- a/runtime/ops/tty.rs
+++ b/runtime/ops/tty.rs
@@ -79,9 +79,6 @@ deno_core::extension!(
#[cfg(unix)]
state.put(TtyModeStore::default());
},
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
// ref: <https://learn.microsoft.com/en-us/windows/console/setconsolemode>
diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs
index 7952a03f2..e62642fdd 100644
--- a/runtime/ops/web_worker.rs
+++ b/runtime/ops/web_worker.rs
@@ -25,9 +25,6 @@ deno_core::extension!(
op_worker_get_type,
op_worker_sync_fetch,
],
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
#[op]
diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs
index d5285ec89..f96ae38e8 100644
--- a/runtime/ops/worker_host.rs
+++ b/runtime/ops/worker_host.rs
@@ -119,9 +119,6 @@ deno_core::extension!(
FormatJsErrorFnHolder(options.format_js_error_fn);
state.put::<FormatJsErrorFnHolder>(format_js_error_fn_holder);
},
- customizer = |ext: &mut deno_core::ExtensionBuilder| {
- ext.force_op_registration();
- },
);
#[derive(Deserialize)]