diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-11-04 16:38:52 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-11-04 10:38:52 -0500 |
commit | 0049d4e50c9dd945f25f69b08b08fbf492001f96 (patch) | |
tree | 3bcf3c50bdba9abba6b1b8ff9340f76fc19f759c /cli/ops/compiler.rs | |
parent | 429439d1983269ba40141a1b42f6ac809d1e8c86 (diff) |
Refactor Worker and ThreadSafeState (#3242)
* Split ThreadSafeState into State and GlobalState. State is a "local"
state belonging to "Worker" while "GlobalState" is state shared by
whole program.
* Update "Worker" and ops to use "GlobalState" where applicable
* Move and refactor "WorkerChannels" resource
Diffstat (limited to 'cli/ops/compiler.rs')
-rw-r--r-- | cli/ops/compiler.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/ops/compiler.rs b/cli/ops/compiler.rs index 720eb65fc..e7d38f364 100644 --- a/cli/ops/compiler.rs +++ b/cli/ops/compiler.rs @@ -4,6 +4,7 @@ use crate::futures::future::join_all; use crate::futures::Future; use crate::ops::json_op; use crate::state::ThreadSafeState; +use deno::Loader; use deno::*; pub fn init(i: &mut Isolate, s: &ThreadSafeState) { @@ -36,7 +37,7 @@ fn op_cache( let module_specifier = ModuleSpecifier::resolve_url(&args.module_id) .expect("Should be valid module specifier"); - state.ts_compiler.cache_compiler_output( + state.global_state.ts_compiler.cache_compiler_output( &module_specifier, &args.extension, &args.contents, @@ -67,6 +68,7 @@ fn op_fetch_source_files( let resolved_specifier = state.resolve(specifier, &args.referrer, false, is_dyn_import)?; let fut = state + .global_state .file_fetcher .fetch_source_file_async(&resolved_specifier); futures.push(fut); |