diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-03-14 23:14:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 18:44:15 +0100 |
commit | b4e42953e1d243f2eda20e5be6b845d60b7bf688 (patch) | |
tree | 10b3bfff165f9c04f9174c7c399d44b9b724c3b3 /runtime/ops/io.rs | |
parent | 4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff) |
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'runtime/ops/io.rs')
-rw-r--r-- | runtime/ops/io.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/ops/io.rs b/runtime/ops/io.rs index 61f1a2578..35dddaac2 100644 --- a/runtime/ops/io.rs +++ b/runtime/ops/io.rs @@ -3,7 +3,7 @@ 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::AsyncMutFuture; use deno_core::AsyncRefCell; use deno_core::AsyncResult; @@ -69,10 +69,7 @@ static STDERR_HANDLE: Lazy<StdFile> = Lazy::new(|| unsafe { pub fn init() -> Extension { Extension::builder() - .ops(vec![ - ("op_read_sync", op_sync(op_read_sync)), - ("op_write_sync", op_sync(op_write_sync)), - ]) + .ops(vec![op_read_sync::decl(), op_write_sync::decl()]) .build() } @@ -354,6 +351,7 @@ impl Resource for StdFileResource { } } +#[op] fn op_read_sync( state: &mut OpState, rid: ResourceId, @@ -368,6 +366,7 @@ fn op_read_sync( }) } +#[op] fn op_write_sync( state: &mut OpState, rid: ResourceId, |