From 97d8498d46bbfb7bb16eeb3a69565d2aeda1e5aa Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 11 Oct 2019 11:41:54 -0700 Subject: Add init methods for each op module (#3087) --- cli/ops/repl.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cli/ops/repl.rs') diff --git a/cli/ops/repl.rs b/cli/ops/repl.rs index 7ab7509de..886e57483 100644 --- a/cli/ops/repl.rs +++ b/cli/ops/repl.rs @@ -1,17 +1,29 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{blocking_json, Deserialize, JsonOp, Value}; +use crate::ops::json_op; use crate::repl; use crate::resources; use crate::state::ThreadSafeState; use deno::*; +pub fn init(i: &mut Isolate, s: &ThreadSafeState) { + i.register_op( + "repl_start", + s.core_op(json_op(s.stateful_op(op_repl_start))), + ); + i.register_op( + "repl_readline", + s.core_op(json_op(s.stateful_op(op_repl_readline))), + ); +} + #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct ReplStartArgs { history_file: String, } -pub fn op_repl_start( +fn op_repl_start( state: &ThreadSafeState, args: Value, _zero_copy: Option, @@ -32,7 +44,7 @@ struct ReplReadlineArgs { prompt: String, } -pub fn op_repl_readline( +fn op_repl_readline( _state: &ThreadSafeState, args: Value, _zero_copy: Option, -- cgit v1.2.3