summaryrefslogtreecommitdiff
path: root/cli/ops/plugin.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-08-12 10:44:58 -0400
committerGitHub <noreply@github.com>2020-08-12 16:44:58 +0200
commitf5a4f1fdc04b24cdfbef83842b9c42b5032c4059 (patch)
treef0ead2884b3b69b287a05a82885e30a541116063 /cli/ops/plugin.rs
parent6706eb551532ee6c84ad013377ac2cd91681424a (diff)
Undo JsonOpDispatcher and OpDispatcher traits (#7023)
This reverts commit f83d672ffad7afb1473bd4f9b9c645539064c620. This reverts commit d51972377c1325076704d9faec2eee6f0e024496.
Diffstat (limited to 'cli/ops/plugin.rs')
-rw-r--r--cli/ops/plugin.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/ops/plugin.rs b/cli/ops/plugin.rs
index 3edcaa962..16debac50 100644
--- a/cli/ops/plugin.rs
+++ b/cli/ops/plugin.rs
@@ -3,6 +3,7 @@ use crate::op_error::OpError;
use crate::ops::dispatch_json::Deserialize;
use crate::ops::dispatch_json::JsonOp;
use crate::ops::dispatch_json::Value;
+use crate::ops::json_op;
use crate::state::State;
use deno_core::plugin_api;
use deno_core::CoreIsolate;
@@ -20,7 +21,10 @@ use std::task::Context;
use std::task::Poll;
pub fn init(i: &mut CoreIsolate, s: &State) {
- i.register_op("op_open_plugin", s.stateful_json_op2(op_open_plugin));
+ i.register_op(
+ "op_open_plugin",
+ s.core_op(json_op(s.stateful_op2(op_open_plugin))),
+ );
}
#[derive(Deserialize)]
@@ -106,8 +110,7 @@ impl<'a> plugin_api::Interface for PluginInterface<'a> {
let plugin_lib = self.plugin_lib.clone();
self.isolate_state.op_registry.register(
name,
- move |isolate_state: &mut CoreIsolateState,
- zero_copy: &mut [ZeroCopyBuf]| {
+ move |isolate_state, zero_copy| {
let mut interface = PluginInterface::new(isolate_state, &plugin_lib);
let op = dispatch_op_fn(&mut interface, zero_copy);
match op {