refactor: CLI subcommands and argv (#3886)

This commit is contained in:
Bartek Iwańczuk 2020-02-04 20:24:33 +01:00 committed by GitHub
parent 2ab49a80a6
commit 184be99f5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 332 additions and 341 deletions

View file

@ -7,6 +7,7 @@ use crate::global_state::ThreadSafeGlobalState;
use crate::startup_data;
use crate::state::*;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use futures::FutureExt;
use serde_derive::Deserialize;
use serde_json;
@ -45,8 +46,11 @@ impl WasmCompiler {
/// Create a new V8 worker with snapshot of WASM compiler and setup compiler's runtime.
fn setup_worker(global_state: ThreadSafeGlobalState) -> CompilerWorker {
let (int, ext) = ThreadSafeState::create_channels();
let entry_point =
ModuleSpecifier::resolve_url_or_path("./__$deno$wasm_compiler.ts")
.unwrap();
let worker_state =
ThreadSafeState::new(global_state.clone(), None, None, int)
ThreadSafeState::new(global_state.clone(), None, entry_point, int)
.expect("Unable to create worker state");
// Count how many times we start the compiler worker.