Use globalThis to reference global scope (#3719)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Kitson Kelly 2020-01-21 01:30:30 +11:00 committed by Ry Dahl
parent 23e67eb515
commit 60b53fd6b6
19 changed files with 219 additions and 264 deletions

View file

@ -146,7 +146,7 @@ pub fn compile_bundle(
},
});
let mut root_names_str: Vec<String> = root_names
let root_names_str: Vec<String> = root_names
.iter()
.map(|p| {
if !p.exists() {
@ -158,7 +158,6 @@ pub fn compile_bundle(
module_specifier.as_str().to_string()
})
.collect();
root_names_str.push("$asset$/lib.deno_core.d.ts".to_string());
// TODO lift js_check to caller?
let state = js_check(ts_isolate.compile(&config_json, root_names_str));
@ -267,9 +266,6 @@ pub fn get_asset(name: &str) -> Option<String> {
"bundle_loader.js" => {
Some(read_file("../deno_typescript/bundle_loader.js"))
}
"lib.deno_core.d.ts" => {
Some(read_file("../deno_typescript/lib.deno_core.d.ts"))
}
"lib.deno_runtime.d.ts" => Some(read_file("js/lib.deno_runtime.d.ts")),
"bootstrap.ts" => Some("console.log(\"hello deno\");".to_string()),
"typescript.d.ts" => inc!("typescript.d.ts"),