From 27f4aeb92469660fdd78a89a7b2902c08a23ca4a Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 18 Aug 2020 18:30:13 +0200 Subject: Make Rc/Arc wrapper around State/GlobalState visible (#7104) --- cli/ops/errors.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cli/ops/errors.rs') diff --git a/cli/ops/errors.rs b/cli/ops/errors.rs index ade125b1a..02295d7f8 100644 --- a/cli/ops/errors.rs +++ b/cli/ops/errors.rs @@ -8,8 +8,9 @@ use crate::state::State; use deno_core::CoreIsolate; use deno_core::ZeroCopyBuf; use std::collections::HashMap; +use std::rc::Rc; -pub fn init(i: &mut CoreIsolate, s: &State) { +pub fn init(i: &mut CoreIsolate, s: &Rc) { i.register_op( "op_apply_source_map", s.stateful_json_op(op_apply_source_map), @@ -29,7 +30,7 @@ struct ApplySourceMap { } fn op_apply_source_map( - state: &State, + state: &Rc, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -42,7 +43,7 @@ fn op_apply_source_map( args.line_number.into(), args.column_number.into(), &mut mappings_map, - &state.borrow().global_state.ts_compiler, + &state.global_state.ts_compiler, ); Ok(JsonOp::Sync(json!({ @@ -53,7 +54,7 @@ fn op_apply_source_map( } fn op_format_diagnostic( - _state: &State, + _state: &Rc, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { -- cgit v1.2.3