summaryrefslogtreecommitdiff
path: root/cli/global_state.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-01-29 18:54:23 +0100
committerGitHub <noreply@github.com>2020-01-29 18:54:23 +0100
commit161adfc51b750a7c8c62a898ea9948c2ad5b6cd9 (patch)
tree6d53db2a4acd30207372f665a3ba463e26db6fcf /cli/global_state.rs
parentd14864c57cebbd1d5bc18b8a9e05e522eb9987b0 (diff)
workers: proper TS libs, more spec-compliant APIs (#3812)
* split lib.deno_main.d.ts into: - lib.deno.shared_globals.d.ts - lib.deno.window.d.ts - lib.deno.worker.d.ts * remove no longer used libs: - lib.deno_main.d.ts - lib.deno_worker.d.ts * change module loading to use proper TS library for compilation * align to Worker API spec: - Worker.terminate() - self.close() - self.name
Diffstat (limited to 'cli/global_state.rs')
-rw-r--r--cli/global_state.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs
index 1709a3429..3298799d1 100644
--- a/cli/global_state.rs
+++ b/cli/global_state.rs
@@ -2,6 +2,7 @@
use crate::compilers::CompiledModule;
use crate::compilers::JsCompiler;
use crate::compilers::JsonCompiler;
+use crate::compilers::TargetLib;
use crate::compilers::TsCompiler;
use crate::compilers::WasmCompiler;
use crate::deno_dir;
@@ -122,6 +123,7 @@ impl ThreadSafeGlobalState {
&self,
module_specifier: &ModuleSpecifier,
maybe_referrer: Option<ModuleSpecifier>,
+ target_lib: TargetLib,
) -> impl Future<Output = Result<CompiledModule, ErrBox>> {
let state1 = self.clone();
let state2 = self.clone();
@@ -141,11 +143,15 @@ impl ThreadSafeGlobalState {
msg::MediaType::TypeScript
| msg::MediaType::TSX
| msg::MediaType::JSX => {
- state1.ts_compiler.compile_async(state1.clone(), &out)
+ state1
+ .ts_compiler
+ .compile_async(state1.clone(), &out, target_lib)
}
msg::MediaType::JavaScript => {
if state1.ts_compiler.compile_js {
- state1.ts_compiler.compile_async(state1.clone(), &out)
+ state1
+ .ts_compiler
+ .compile_async(state1.clone(), &out, target_lib)
} else {
state1.js_compiler.compile_async(&out)
}