From 7c2abb9d579d13fa61339c24f8c39bc3c27c25db Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 3 Nov 2021 09:27:36 -0400 Subject: fix: Deno.emit crashes with BorrowMutError (#12627) Warn on await_holding_refcell_ref clippy rule to avoid this in the future. Fixes #12453 --- cli/ops/runtime_compiler.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cli/ops') diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs index ab6992d19..8f7a75146 100644 --- a/cli/ops/runtime_compiler.rs +++ b/cli/ops/runtime_compiler.rs @@ -88,9 +88,15 @@ async fn op_emit( ) -> Result { deno_runtime::ops::check_unstable2(&state, "Deno.emit"); let root_specifier = args.root_specifier; - let state = state.borrow(); - let ps = state.borrow::(); - let mut runtime_permissions = { state.borrow::().clone() }; + let ps = { + let state = state.borrow(); + state.borrow::().clone() + }; + let mut runtime_permissions = { + let state = state.borrow(); + state.borrow::().clone() + }; + let mut cache: Box = if let Some(sources) = &args.sources { Box::new(cache::MemoryCacher::new(sources.clone())) -- cgit v1.2.3