diff options
Diffstat (limited to 'src/mono/wasm/runtime/startup.ts')
-rw-r--r-- | src/mono/wasm/runtime/startup.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mono/wasm/runtime/startup.ts b/src/mono/wasm/runtime/startup.ts index c33549c2717..5a5e69cd441 100644 --- a/src/mono/wasm/runtime/startup.ts +++ b/src/mono/wasm/runtime/startup.ts @@ -17,6 +17,7 @@ import { DotnetPublicAPI } from "./exports"; import { mono_on_abort } from "./run"; import { mono_wasm_new_root } from "./roots"; import { init_crypto } from "./crypto-worker"; +import { init_polyfills } from "./polyfills"; export let runtime_is_initialized_resolve: () => void; export let runtime_is_initialized_reject: (reason?: any) => void; @@ -118,9 +119,10 @@ async function mono_wasm_pre_init(): Promise<void> { // wait for locateFile setup on NodeJs if (ENVIRONMENT_IS_NODE && ENVIRONMENT_IS_ESM) { - await requirePromise; + INTERNAL.require = await requirePromise; } + init_polyfills(); init_crypto(); if (moduleExt.configSrc) { @@ -156,6 +158,9 @@ async function mono_wasm_pre_init(): Promise<void> { throw err; } } + if (!moduleExt.configSrc && !moduleExt.config) { + Module.print("MONO_WASM: configSrc nor config was specified"); + } Module.removeRunDependency("mono_wasm_pre_init"); } @@ -166,6 +171,9 @@ function mono_wasm_after_runtime_initialized(): void { } finalize_assets(Module.config); finalize_startup(Module.config); + if (!ctx || !ctx.loaded_files || ctx.loaded_files.length == 0) { + Module.print("MONO_WASM: no files were loaded into runtime"); + } } function _print_error(message: string, err: any): void { |