@@ -26,7 +26,7 @@ import {
2626 mono_wasm_add_dbg_command_received ,
2727 mono_wasm_change_debugger_log_level ,
2828} from "./debug" ;
29- import { runtimeHelpers , setImportsAndExports } from "./imports" ;
29+ import { ENVIRONMENT_IS_WEB , ExitStatusError , runtimeHelpers , setImportsAndExports } from "./imports" ;
3030import { DotnetModuleConfigImports , DotnetModule } from "./types" ;
3131import {
3232 mono_load_runtime_and_bcl_args , mono_wasm_load_config ,
@@ -132,9 +132,9 @@ let exportedAPI: DotnetPublicAPI;
132132// it exports methods to global objects MONO, BINDING and Module in backward compatible way
133133// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
134134function initializeImportsAndExports (
135- imports : { isESM : boolean , isGlobal : boolean , isNode : boolean , isShell : boolean , isWeb : boolean , locateFile : Function , quit_ : Function , requirePromise : Promise < Function > } ,
135+ imports : { isESM : boolean , isGlobal : boolean , isNode : boolean , isShell : boolean , isWeb : boolean , locateFile : Function , quit_ : Function , ExitStatus : ExitStatusError , requirePromise : Promise < Function > } ,
136136 exports : { mono : any , binding : any , internal : any , module : any } ,
137- replacements : { fetch : any , readAsync : any , require : any , requireOut : any } ,
137+ replacements : { fetch : any , readAsync : any , require : any , requireOut : any , noExitRuntime : boolean } ,
138138) : DotnetPublicAPI {
139139 const module = exports . module as DotnetModule ;
140140 const globalThisAny = globalThis as any ;
@@ -192,6 +192,8 @@ function initializeImportsAndExports(
192192 replacements . readAsync = readAsync_like ;
193193 replacements . requireOut = module . imports . require ;
194194
195+ replacements . noExitRuntime = ENVIRONMENT_IS_WEB ;
196+
195197 if ( typeof module . disableDotnet6Compatibility === "undefined" ) {
196198 module . disableDotnet6Compatibility = imports . isESM ;
197199 }
0 commit comments