summaryrefslogtreecommitdiff
path: root/cli/ops
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops')
-rw-r--r--cli/ops/errors.rs4
-rw-r--r--cli/ops/mod.rs12
-rw-r--r--cli/ops/runtime_compiler.rs2
3 files changed, 9 insertions, 9 deletions
diff --git a/cli/ops/errors.rs b/cli/ops/errors.rs
index 5dc4026f7..b3591b6f9 100644
--- a/cli/ops/errors.rs
+++ b/cli/ops/errors.rs
@@ -15,8 +15,8 @@ use std::collections::HashMap;
use std::sync::Arc;
pub fn init(rt: &mut deno_core::JsRuntime) {
- super::reg_json_sync(rt, "op_apply_source_map", op_apply_source_map);
- super::reg_json_sync(rt, "op_format_diagnostic", op_format_diagnostic);
+ super::reg_sync(rt, "op_apply_source_map", op_apply_source_map);
+ super::reg_sync(rt, "op_format_diagnostic", op_format_diagnostic);
}
#[derive(Deserialize)]
diff --git a/cli/ops/mod.rs b/cli/ops/mod.rs
index 782b0a201..8caede260 100644
--- a/cli/ops/mod.rs
+++ b/cli/ops/mod.rs
@@ -4,8 +4,8 @@ pub mod errors;
pub mod runtime_compiler;
use deno_core::error::AnyError;
-use deno_core::json_op_async;
-use deno_core::json_op_sync;
+use deno_core::op_async;
+use deno_core::op_sync;
use deno_core::serde_json::Value;
use deno_core::JsRuntime;
use deno_core::OpState;
@@ -15,18 +15,18 @@ use std::cell::RefCell;
use std::future::Future;
use std::rc::Rc;
-pub fn reg_json_async<F, R>(rt: &mut JsRuntime, name: &'static str, op_fn: F)
+pub fn reg_async<F, R>(rt: &mut JsRuntime, name: &'static str, op_fn: F)
where
F: Fn(Rc<RefCell<OpState>>, Value, Option<ZeroCopyBuf>) -> R + 'static,
R: Future<Output = Result<Value, AnyError>> + 'static,
{
- rt.register_op(name, metrics_op(name, json_op_async(op_fn)));
+ rt.register_op(name, metrics_op(name, op_async(op_fn)));
}
-pub fn reg_json_sync<F>(rt: &mut JsRuntime, name: &'static str, op_fn: F)
+pub fn reg_sync<F>(rt: &mut JsRuntime, name: &'static str, op_fn: F)
where
F: Fn(&mut OpState, Value, Option<ZeroCopyBuf>) -> Result<Value, AnyError>
+ 'static,
{
- rt.register_op(name, metrics_op(name, json_op_sync(op_fn)));
+ rt.register_op(name, metrics_op(name, op_sync(op_fn)));
}
diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs
index acd307f2f..dc9cd2163 100644
--- a/cli/ops/runtime_compiler.rs
+++ b/cli/ops/runtime_compiler.rs
@@ -28,7 +28,7 @@ use std::sync::Arc;
use std::sync::Mutex;
pub fn init(rt: &mut deno_core::JsRuntime) {
- super::reg_json_async(rt, "op_emit", op_emit);
+ super::reg_async(rt, "op_emit", op_emit);
}
#[derive(Debug, Deserialize)]