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 /cli/ops/errors.rs | |
parent | 4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff) |
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'cli/ops/errors.rs')
-rw-r--r-- | cli/ops/errors.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/ops/errors.rs b/cli/ops/errors.rs index a9193b0cd..c215ade41 100644 --- a/cli/ops/errors.rs +++ b/cli/ops/errors.rs @@ -6,7 +6,7 @@ use crate::proc_state::ProcState; use crate::source_maps::get_orig_position; use crate::source_maps::CachedMaps; use deno_core::error::AnyError; -use deno_core::op_sync; +use deno_core::op; use deno_core::serde_json; use deno_core::serde_json::json; use deno_core::serde_json::Value; @@ -19,9 +19,9 @@ use std::collections::HashMap; pub fn init() -> Extension { Extension::builder() .ops(vec![ - ("op_apply_source_map", op_sync(op_apply_source_map)), - ("op_format_diagnostic", op_sync(op_format_diagnostic)), - ("op_format_file_name", op_sync(op_format_file_name)), + op_apply_source_map::decl(), + op_format_diagnostic::decl(), + op_format_file_name::decl(), ]) .build() } @@ -42,6 +42,7 @@ struct AppliedSourceMap { column_number: u32, } +#[op] fn op_apply_source_map( state: &mut OpState, args: ApplySourceMap, @@ -66,6 +67,7 @@ fn op_apply_source_map( }) } +#[op] fn op_format_diagnostic( _state: &mut OpState, args: Value, @@ -75,6 +77,7 @@ fn op_format_diagnostic( Ok(json!(diagnostic.to_string())) } +#[op] fn op_format_file_name( _state: &mut OpState, file_name: String, |