summaryrefslogtreecommitdiff
path: root/runtime/ops/tty.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-03-14 23:14:15 +0530
committerGitHub <noreply@github.com>2022-03-14 18:44:15 +0100
commitb4e42953e1d243f2eda20e5be6b845d60b7bf688 (patch)
tree10b3bfff165f9c04f9174c7c399d44b9b724c3b3 /runtime/ops/tty.rs
parent4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff)
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'runtime/ops/tty.rs')
-rw-r--r--runtime/ops/tty.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs
index ee6b112bc..bbf6bd412 100644
--- a/runtime/ops/tty.rs
+++ b/runtime/ops/tty.rs
@@ -5,7 +5,7 @@ use deno_core::error::bad_resource_id;
use deno_core::error::not_supported;
use deno_core::error::resource_unavailable;
use deno_core::error::AnyError;
-use deno_core::op_sync;
+use deno_core::op;
use deno_core::Extension;
use deno_core::OpState;
use deno_core::RcRef;
@@ -47,9 +47,9 @@ fn get_windows_handle(
pub fn init() -> Extension {
Extension::builder()
.ops(vec![
- ("op_set_raw", op_sync(op_set_raw)),
- ("op_isatty", op_sync(op_isatty)),
- ("op_console_size", op_sync(op_console_size)),
+ op_set_raw::decl(),
+ op_isatty::decl(),
+ op_console_size::decl(),
])
.build()
}
@@ -67,6 +67,7 @@ pub struct SetRawArgs {
options: SetRawOptions,
}
+#[op]
fn op_set_raw(
state: &mut OpState,
args: SetRawArgs,
@@ -211,6 +212,7 @@ fn op_set_raw(
}
}
+#[op]
fn op_isatty(
state: &mut OpState,
rid: ResourceId,
@@ -245,6 +247,7 @@ struct ConsoleSize {
rows: u32,
}
+#[op]
fn op_console_size(
state: &mut OpState,
rid: ResourceId,