diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-04-21 15:22:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-21 15:22:45 +0200 |
commit | 1d447cb7c3295941be85a05b455f45d89e119667 (patch) | |
tree | 118635a7bcb8e75fbe067a16e351711f946ebd75 /runtime/ops/os | |
parent | 4e944dea1d6ad6cc819cbef278b59923eeaa2287 (diff) |
refactor(core): remove ops from Deno.core.ops that are disabled (#18793)
This commit changes how "disabled" ops behave. Instead of using "void"
functions under the hood, they now explicitly throw errors saying
that a given op doesn't exist.
Diffstat (limited to 'runtime/ops/os')
-rw-r--r-- | runtime/ops/os/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs index 70a126301..911cd327c 100644 --- a/runtime/ops/os/mod.rs +++ b/runtime/ops/os/mod.rs @@ -57,7 +57,10 @@ 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" | "op_set_exit_code" => deno_core::OpDecl { + v8_fn_ptr: deno_core::op_void_sync::v8_fn_ptr as _, + ..op + }, _ => op, }, customizer = |ext: &mut deno_core::ExtensionBuilder| { |