return MONO.string_decoder.copy (mono_obj);
}
},
+
+ mono_wasm_invoke_js_blazor: function(exceptionMessage, callInfo, arg0, arg1, arg2) {
+ try {
+ var blazorExports = DOTNET._dotnet_get_global().Blazor;
+ if (!blazorExports) {
+ throw new Error('The blazor.webassembly.js library is not loaded.');
+ }
+
+ return blazorExports._internal.invokeJSFromDotNet(callInfo, arg0, arg1, arg2);
+ } catch (ex) {
+ var exceptionJsString = ex.message + '\n' + ex.stack;
+ var exceptionSystemString = mono_string(exceptionJsString);
+ setValue (exceptionMessage, exceptionSystemString, 'i32'); // *exceptionMessage = exceptionSystemString;
+ return 0;
+ }
+ },
+
+ // This is for back-compat only and will eventually be removed
mono_wasm_invoke_js_marshalled: function(exceptionMessage, asyncHandleLongPtr, functionName, argsJson, treatResultAsVoid) {
var mono_string = DOTNET._dotnet_get_global()._mono_string_cached
return 0;
}
},
+
+ // This is for back-compat only and will eventually be removed
mono_wasm_invoke_js_unmarshalled: function(exceptionMessage, funcName, arg0, arg1, arg2) {
try {
// Get the function you're trying to invoke
#endif
// Blazor specific custom routines - see dotnet_support.js for backing code
+extern void* mono_wasm_invoke_js_blazor (MonoString **exceptionMessage, void *callInfo, void* arg0, void* arg1, void* arg2);
+// The following two are for back-compat and will eventually be removed
extern void* mono_wasm_invoke_js_marshalled (MonoString **exceptionMessage, void *asyncHandleLongPtr, MonoString *funcName, MonoString *argsJson);
extern void* mono_wasm_invoke_js_unmarshalled (MonoString **exceptionMessage, MonoString *funcName, void* arg0, void* arg1, void* arg2);
// TODO: what happens when two types in different assemblies have the same FQN?
// Blazor specific custom routines - see dotnet_support.js for backing code
+ mono_add_internal_call ("WebAssembly.JSInterop.InternalCalls::InvokeJS", mono_wasm_invoke_js_blazor);
+ // The following two are for back-compat and will eventually be removed
mono_add_internal_call ("WebAssembly.JSInterop.InternalCalls::InvokeJSMarshalled", mono_wasm_invoke_js_marshalled);
mono_add_internal_call ("WebAssembly.JSInterop.InternalCalls::InvokeJSUnmarshalled", mono_wasm_invoke_js_unmarshalled);