summaryrefslogtreecommitdiff
path: root/cli/ops/dispatch_json.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-05-29 17:41:39 -0400
committerGitHub <noreply@github.com>2020-05-29 17:41:39 -0400
commitd4b05dd89e94ed1bba5b24c683da0a895f2ce597 (patch)
tree7e098257f5558a624e1d691f92c4d6d4cef56667 /cli/ops/dispatch_json.rs
parent106b00173806e088472e123d04fdc8d260c3820d (diff)
refactor: Split isolate and state using safe get_slot() (#5929)
Diffstat (limited to 'cli/ops/dispatch_json.rs')
-rw-r--r--cli/ops/dispatch_json.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/cli/ops/dispatch_json.rs b/cli/ops/dispatch_json.rs
index 6125ea39b..c2c103f69 100644
--- a/cli/ops/dispatch_json.rs
+++ b/cli/ops/dispatch_json.rs
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::op_error::OpError;
use deno_core::Buf;
-use deno_core::CoreIsolate;
+use deno_core::CoreIsolateState;
use deno_core::Op;
use deno_core::ZeroCopyBuf;
use futures::future::FutureExt;
@@ -46,12 +46,15 @@ struct AsyncArgs {
pub fn json_op<D>(
d: D,
-) -> impl Fn(&mut CoreIsolate, &[u8], Option<ZeroCopyBuf>) -> Op
+) -> impl Fn(&mut CoreIsolateState, &[u8], Option<ZeroCopyBuf>) -> Op
where
- D:
- Fn(&mut CoreIsolate, Value, Option<ZeroCopyBuf>) -> Result<JsonOp, OpError>,
+ D: Fn(
+ &mut CoreIsolateState,
+ Value,
+ Option<ZeroCopyBuf>,
+ ) -> Result<JsonOp, OpError>,
{
- move |isolate: &mut CoreIsolate,
+ move |isolate_state: &mut CoreIsolateState,
control: &[u8],
zero_copy: Option<ZeroCopyBuf>| {
let async_args: AsyncArgs = match serde_json::from_slice(control) {
@@ -66,7 +69,7 @@ where
let result = serde_json::from_slice(control)
.map_err(OpError::from)
- .and_then(|args| d(isolate, args, zero_copy));
+ .and_then(|args| d(isolate_state, args, zero_copy));
// Convert to Op
match result {