@@ -11,6 +11,7 @@ let assembly_load: (assemblyName: string) => number;
11
11
let find_class : ( assemblyHandle : number , namespace : string , className : string ) => number ;
12
12
let find_method : ( typeHandle : number , methodName : string , unknownArg : number ) => MethodHandle ;
13
13
let invoke_method : ( method : MethodHandle , target : System_Object , argsArrayPtr : number , exceptionFlagIntPtr : number ) => System_Object ;
14
+ let mono_call_assembly_entry_point : ( assemblyName : string , args : System_Object [ ] ) => System_Object ;
14
15
let mono_string_get_utf8 : ( managedString : System_String ) => Mono . Utf8Ptr ;
15
16
let mono_string : ( jsString : string ) => System_String ;
16
17
const appBinDirName = 'appBinDir' ;
@@ -39,21 +40,8 @@ export const monoPlatform: Platform = {
39
40
40
41
findMethod : findMethod ,
41
42
42
- callEntryPoint : function callEntryPoint ( assemblyName : string , entrypointMethod : string , args : System_Object [ ] ) : void {
43
- // Parse the entrypointMethod, which is of the form MyApp.MyNamespace.MyTypeName::MyMethodName
44
- // Note that we don't support specifying a method overload, so it has to be unique
45
- const entrypointSegments = entrypointMethod . split ( '::' ) ;
46
- if ( entrypointSegments . length != 2 ) {
47
- throw new Error ( 'Malformed entry point method name; could not resolve class name and method name.' ) ;
48
- }
49
- const typeFullName = entrypointSegments [ 0 ] ;
50
- const methodName = entrypointSegments [ 1 ] ;
51
- const lastDot = typeFullName . lastIndexOf ( '.' ) ;
52
- const namespace = lastDot > - 1 ? typeFullName . substring ( 0 , lastDot ) : '' ;
53
- const typeShortName = lastDot > - 1 ? typeFullName . substring ( lastDot + 1 ) : typeFullName ;
54
-
55
- const entryPointMethodHandle = monoPlatform . findMethod ( assemblyName , namespace , typeShortName , methodName ) ;
56
- monoPlatform . callMethod ( entryPointMethodHandle , null , args ) ;
43
+ callEntryPoint : function callEntryPoint ( assemblyName : string ) : System_Object {
44
+ return mono_call_assembly_entry_point ( assemblyName , [ ] ) ;
57
45
} ,
58
46
59
47
callMethod : function callMethod ( method : MethodHandle , target : System_Object , args : System_Object [ ] ) : System_Object {
@@ -272,6 +260,8 @@ function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: ()
272
260
'number' ,
273
261
'number' ,
274
262
] ) ;
263
+
264
+ mono_call_assembly_entry_point = Module . mono_call_assembly_entry_point ;
275
265
mono_string_get_utf8 = Module . cwrap ( 'mono_wasm_string_get_utf8' , 'number' , [ 'number' ] ) ;
276
266
mono_string = Module . cwrap ( 'mono_wasm_string_from_js' , 'number' , [ 'string' ] ) ;
277
267
0 commit comments