diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-18 10:59:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-18 14:59:51 +0000 |
commit | d11e89127d723d84afe6e5603b731c014a54f9da (patch) | |
tree | 06dbfe0b8d8eb965e477472cff223a8d335c50ad /runtime/ops | |
parent | 8af0c8351935ea7c6c0441055d5164908322c9d6 (diff) |
Revert "perf(core): preserve ops between snapshots (#18080)" (#18267)
This reverts commit 4b6305f4f25fc76f974bbdcc9cdb139d5ab8f5f4.
Diffstat (limited to 'runtime/ops')
-rw-r--r-- | runtime/ops/fs_events.rs | 5 | ||||
-rw-r--r-- | runtime/ops/http.rs | 3 | ||||
-rw-r--r-- | runtime/ops/os/mod.rs | 14 | ||||
-rw-r--r-- | runtime/ops/permissions.rs | 5 | ||||
-rw-r--r-- | runtime/ops/process.rs | 5 | ||||
-rw-r--r-- | runtime/ops/runtime.rs | 5 | ||||
-rw-r--r-- | runtime/ops/signal.rs | 5 | ||||
-rw-r--r-- | runtime/ops/tty.rs | 5 | ||||
-rw-r--r-- | runtime/ops/web_worker.rs | 5 | ||||
-rw-r--r-- | runtime/ops/worker_host.rs | 5 |
10 files changed, 15 insertions, 42 deletions
diff --git a/runtime/ops/fs_events.rs b/runtime/ops/fs_events.rs index 27e76b3d3..05cc22152 100644 --- a/runtime/ops/fs_events.rs +++ b/runtime/ops/fs_events.rs @@ -30,10 +30,7 @@ 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(); - }, + ops = [op_fs_events_open, op_fs_events_poll] ); struct FsEventsResource { diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs index 3a316d800..b9899b4e3 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, op_flash_upgrade_http], - 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 70a126301..b34629395 100644 --- a/runtime/ops/os/mod.rs +++ b/runtime/ops/os/mod.rs @@ -48,24 +48,24 @@ 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!( deno_os_worker, ops_fn = deno_ops, middleware = |op| match op.name { - "op_exit" | "op_set_exit_code" => op.disable(), + "op_exit" => noop_op::decl(), + "op_set_exit_code" => noop_op::decl(), _ => op, }, - customizer = |ext: &mut deno_core::ExtensionBuilder| { - ext.force_op_registration(); - } ); #[op] +fn noop_op() -> Result<(), AnyError> { + Ok(()) +} + +#[op] fn op_exec_path(state: &mut OpState) -> Result<String, AnyError> { let current_exe = env::current_exe().unwrap(); state diff --git a/runtime/ops/permissions.rs b/runtime/ops/permissions.rs index 6f7b98a30..c08d11e4a 100644 --- a/runtime/ops/permissions.rs +++ b/runtime/ops/permissions.rs @@ -17,10 +17,7 @@ deno_core::extension!( op_query_permission, 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 cf8740255..a15b63f80 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -107,10 +107,7 @@ deno_core::extension!( deprecated::op_run, deprecated::op_run_status, deprecated::op_kill, - ], - customizer = |ext: &mut deno_core::ExtensionBuilder| { - ext.force_op_registration(); - }, + ] ); struct ChildResource(tokio::process::Child); diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs index 8802f9cd6..a77e888c8 100644 --- a/runtime/ops/runtime.rs +++ b/runtime/ops/runtime.rs @@ -12,10 +12,7 @@ deno_core::extension!( options = { main_module: ModuleSpecifier }, 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 93e1cfef2..9cc261d85 100644 --- a/runtime/ops/signal.rs +++ b/runtime/ops/signal.rs @@ -31,10 +31,7 @@ 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(); - }, + ops = [op_signal_bind, op_signal_unbind, op_signal_poll] ); #[cfg(unix)] diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index 3146f22e2..60144e408 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -34,10 +34,7 @@ fn get_windows_handle( deno_core::extension!( deno_tty, - ops = [op_stdin_set_raw, op_isatty, op_console_size], - customizer = |ext: &mut deno_core::ExtensionBuilder| { - ext.force_op_registration(); - }, + ops = [op_stdin_set_raw, op_isatty, op_console_size] ); // 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..45137913e 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -24,10 +24,7 @@ deno_core::extension!( op_worker_close, 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..26c99efab 100644 --- a/runtime/ops/worker_host.rs +++ b/runtime/ops/worker_host.rs @@ -118,10 +118,7 @@ deno_core::extension!( let format_js_error_fn_holder = 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)] |