diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/js/compiler_api_test.ts | 4 | ||||
-rw-r--r-- | cli/js/compiler_bundler.ts | 8 | ||||
-rw-r--r-- | cli/js/runtime_main.ts | 24 | ||||
-rw-r--r-- | cli/source_maps.rs | 2 | ||||
-rw-r--r-- | cli/tests/bundle.test.out | 4 |
5 files changed, 21 insertions, 21 deletions
diff --git a/cli/js/compiler_api_test.ts b/cli/js/compiler_api_test.ts index fcca0a22b..762e7378c 100644 --- a/cli/js/compiler_api_test.ts +++ b/cli/js/compiler_api_test.ts @@ -109,14 +109,14 @@ test(async function bundleApiSources() { "/bar.ts": `export const bar = "bar";\n` }); assert(diagnostics == null); - assert(actual.includes(`__inst_s("foo")`)); + assert(actual.includes(`__instantiate("foo")`)); assert(actual.includes(`__exp["bar"]`)); }); test(async function bundleApiNoSources() { const [diagnostics, actual] = await bundle("./cli/tests/subdir/mod1.ts"); assert(diagnostics == null); - assert(actual.includes(`__inst_s("mod1")`)); + assert(actual.includes(`__instantiate("mod1")`)); assert(actual.includes(`__exp["printHello3"]`)); }); diff --git a/cli/js/compiler_bundler.ts b/cli/js/compiler_bundler.ts index f8f0b48e8..a7a021470 100644 --- a/cli/js/compiler_bundler.ts +++ b/cli/js/compiler_bundler.ts @@ -50,8 +50,8 @@ export function buildBundle( let instantiate: string; if (rootExports && rootExports.length) { instantiate = hasTla - ? `const __exp = await __inst("${rootName}");\n` - : `const __exp = __inst_s("${rootName}");\n`; + ? `const __exp = await __instantiateAsync("${rootName}");\n` + : `const __exp = __instantiate("${rootName}");\n`; for (const rootExport of rootExports) { if (rootExport === "default") { instantiate += `export default __exp["${rootExport}"];\n`; @@ -61,8 +61,8 @@ export function buildBundle( } } else { instantiate = hasTla - ? `await __inst("${rootName}");\n` - : `__inst_s("${rootName}");\n`; + ? `await __instantiateAsync("${rootName}");\n` + : `__instantiate("${rootName}");\n`; } return `${SYSTEM_LOADER}\n${data}\n${instantiate}`; } diff --git a/cli/js/runtime_main.ts b/cli/js/runtime_main.ts index 96bda3cb0..1298fe90e 100644 --- a/cli/js/runtime_main.ts +++ b/cli/js/runtime_main.ts @@ -7,6 +7,9 @@ // - `bootstrapMainRuntime` - must be called once, when Isolate is created. // It sets up runtime by providing globals for `WindowScope` and adds `Deno` global. +import * as Deno from "./deno.ts"; +import * as domTypes from "./dom_types.ts"; +import * as csprng from "./get_random_values.ts"; import { readOnly, writable, @@ -14,21 +17,18 @@ import { windowOrWorkerGlobalScopeProperties, eventTargetProperties } from "./globals.ts"; -import * as domTypes from "./dom_types.ts"; -import { log } from "./util.ts"; -import * as runtime from "./runtime.ts"; -import { args } from "./deno.ts"; -import * as csprng from "./get_random_values.ts"; -import { replLoop } from "./repl.ts"; -import { setSignals } from "./process.ts"; -import * as Deno from "./deno.ts"; import { internalObject } from "./internals.ts"; +import { setSignals } from "./process.ts"; +import { replLoop } from "./repl.ts"; +import * as runtime from "./runtime.ts"; +import { symbols } from "./symbols.ts"; +import { log } from "./util.ts"; // TODO: factor out `Deno` global assignment to separate function // Add internal object to Deno object. // This is not exposed as part of the Deno types. // @ts-ignore -Deno[Deno.symbols.internal] = internalObject; +Deno[symbols.internal] = internalObject; export const mainRuntimeGlobalProperties = { window: readOnly(globalThis), @@ -74,10 +74,10 @@ export function bootstrapMainRuntime(): void { log("cwd", s.cwd); for (let i = 0; i < s.args.length; i++) { - args.push(s.args[i]); + Deno.args.push(s.args[i]); } - log("args", args); - Object.freeze(args); + log("args", Deno.args); + Object.freeze(Deno.args); if (s.repl) { replLoop(); diff --git a/cli/source_maps.rs b/cli/source_maps.rs index 9e29e554c..6cf5bfbbd 100644 --- a/cli/source_maps.rs +++ b/cli/source_maps.rs @@ -389,7 +389,7 @@ mod tests { assert_eq!(actual.message, "TypeError: baz"); // Because this is accessing the live bundle, this test might be more fragile assert_eq!(actual.frames.len(), 1); - assert!(actual.frames[0].script_name.ends_with("/dom_types.ts")); + assert_eq!(actual.frames[0].script_name, "$deno$/io.ts"); } #[test] diff --git a/cli/tests/bundle.test.out b/cli/tests/bundle.test.out index 778754c34..b286dad48 100644 --- a/cli/tests/bundle.test.out +++ b/cli/tests/bundle.test.out @@ -1,5 +1,5 @@ [WILDCARD] -let System, __inst, __inst_s; +let System, __instantiateAsync, __instantiate; [WILDCARD] (() => { [WILDCARD] @@ -15,7 +15,7 @@ System.register("mod1", ["subdir2/mod2"], function (exports_3, context_3) { [WILDCARD] }); -const __exp = __inst_s("mod1"); +const __exp = __instantiate("mod1"); export const returnsHi = __exp["returnsHi"]; export const returnsFoo2 = __exp["returnsFoo2"]; export const printHello3 = __exp["printHello3"]; |