From b657d743a22802b8232fbf558f2f00bf2942096f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 20 Sep 2020 01:17:35 +0200 Subject: refactor: remove CliState, use OpState, add CliModuleLoader (#7588) - remove "CliState.workers" and "CliState.next_worker_id", instead store them on "OpState" using type aliases. - remove "CliState.global_timer" and "CliState.start_time", instead store them on "OpState" using type aliases. - remove "CliState.is_internal", instead pass it to Worker::new - move "CliState::permissions" to "OpState" - move "CliState::main_module" to "OpState" - move "CliState::global_state" to "OpState" - move "CliState::check_unstable()" to "GlobalState" - change "cli_state()" to "global_state()" - change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks - rename "CliState" to "CliModuleLoader" --- cli/ops/signal.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/ops/signal.rs') diff --git a/cli/ops/signal.rs b/cli/ops/signal.rs index a731a72aa..3f4c5c8ee 100644 --- a/cli/ops/signal.rs +++ b/cli/ops/signal.rs @@ -48,7 +48,7 @@ fn op_signal_bind( args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { - super::cli_state(state).check_unstable("Deno.signal"); + super::global_state(state).check_unstable("Deno.signal"); let args: BindSignalArgs = serde_json::from_value(args)?; let rid = state.resource_table.add( "signal", @@ -68,7 +68,7 @@ async fn op_signal_poll( args: Value, _zero_copy: BufVec, ) -> Result { - super::cli_state2(&state).check_unstable("Deno.signal"); + super::global_state2(&state).check_unstable("Deno.signal"); let args: SignalArgs = serde_json::from_value(args)?; let rid = args.rid as u32; @@ -92,7 +92,7 @@ pub fn op_signal_unbind( args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { - super::cli_state(state).check_unstable("Deno.signal"); + super::global_state(state).check_unstable("Deno.signal"); let args: SignalArgs = serde_json::from_value(args)?; let rid = args.rid as u32; let resource = state.resource_table.get_mut::(rid); -- cgit v1.2.3