diff options
Diffstat (limited to 'cli/compilers')
-rw-r--r-- | cli/compilers/compiler_worker.rs | 8 | ||||
-rw-r--r-- | cli/compilers/ts.rs | 13 | ||||
-rw-r--r-- | cli/compilers/wasm.rs | 4 |
3 files changed, 17 insertions, 8 deletions
diff --git a/cli/compilers/compiler_worker.rs b/cli/compilers/compiler_worker.rs index 461194c37..99138bcf0 100644 --- a/cli/compilers/compiler_worker.rs +++ b/cli/compilers/compiler_worker.rs @@ -41,8 +41,16 @@ impl CompilerWorker { let worker = Worker::new(name, startup_data, state_, external_channels); { let mut isolate = worker.isolate.try_lock().unwrap(); + ops::runtime::init(&mut isolate, &state); ops::compiler::init(&mut isolate, &state); ops::web_worker::init(&mut isolate, &state); + ops::errors::init(&mut isolate, &state); + + // for compatibility with Worker scope, though unused at + // the moment + ops::timers::init(&mut isolate, &state); + ops::fetch::init(&mut isolate, &state); + // TODO(bartlomieju): CompilerWorker should not // depend on those ops ops::os::init(&mut isolate, &state); diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index 9b6661f58..946617fa5 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -160,12 +160,13 @@ fn req( root_names: Vec<String>, compiler_config: CompilerConfig, out_file: Option<String>, + target: &str, bundle: bool, ) -> Buf { let j = match (compiler_config.path, compiler_config.content) { (Some(config_path), Some(config_data)) => json!({ "type": request_type as i32, - "target": "main", + "target": target, "rootNames": root_names, "outFile": out_file, "bundle": bundle, @@ -174,7 +175,7 @@ fn req( }), _ => json!({ "type": request_type as i32, - "target": "main", + "target": target, "rootNames": root_names, "outFile": out_file, "bundle": bundle, @@ -248,9 +249,7 @@ impl TsCompiler { worker_state, ext, ); - worker.execute("bootstrapCompilerRuntime('TS')").unwrap(); - worker.execute("bootstrapWorkerRuntime()").unwrap(); - worker.execute("bootstrapTsCompiler()").unwrap(); + worker.execute("bootstrapTsCompilerRuntime()").unwrap(); worker } @@ -271,6 +270,7 @@ impl TsCompiler { root_names, self.config.clone(), out_file, + "main", true, ); @@ -360,12 +360,15 @@ impl TsCompiler { &source_file.url ); + let target = "main"; + let root_names = vec![module_url.to_string()]; let req_msg = req( msg::CompilerRequestType::Compile, root_names, self.config.clone(), None, + target, false, ); diff --git a/cli/compilers/wasm.rs b/cli/compilers/wasm.rs index 637fc7687..f7094724e 100644 --- a/cli/compilers/wasm.rs +++ b/cli/compilers/wasm.rs @@ -60,9 +60,7 @@ impl WasmCompiler { worker_state, ext, ); - worker.execute("bootstrapCompilerRuntime('WASM')").unwrap(); - worker.execute("bootstrapWorkerRuntime()").unwrap(); - worker.execute("bootstrapWasmCompiler()").unwrap(); + worker.execute("bootstrapWasmCompilerRuntime()").unwrap(); worker } |