From bca23e64339f9b41272e4a01e4c1a86602e5c1e4 Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Sun, 24 Nov 2019 07:42:30 -0800 Subject: refactor: Elevate DenoPermissions lock to top level (#3398) --- cli/ops/workers.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cli/ops/workers.rs') diff --git a/cli/ops/workers.rs b/cli/ops/workers.rs index a03290545..4bde38222 100644 --- a/cli/ops/workers.rs +++ b/cli/ops/workers.rs @@ -142,10 +142,13 @@ fn op_create_worker( let (int, ext) = ThreadSafeState::create_channels(); let child_state = ThreadSafeState::new( state.global_state.clone(), + Some(parent_state.permissions.clone()), // by default share with parent Some(module_specifier.clone()), include_deno_namespace, int, )?; + // TODO: add a new option to make child worker not sharing permissions + // with parent (aka .clone(), requests from child won't reflect in parent) let name = format!("USER-WORKER-{}", specifier); let deno_main_call = format!("denoMain({})", include_deno_namespace); let mut worker = -- cgit v1.2.3