Add notes on how to upgrade Mono, plus modify some files to make future

upgrades simpler
This commit is contained in:
Steve Sanderson 2018-05-24 13:51:30 +01:00
parent 353da42cce
commit 5dc5404570
3 changed files with 8 additions and 8 deletions

View File

@ -32,8 +32,8 @@ namespace MonoSanityClient
public static string EvaluateJavaScript(string expression) public static string EvaluateJavaScript(string expression)
{ {
// For tests that call this method, we'll exercise the 'InvokeJSArray' code path // For tests that call this method, we'll exercise the 'BlazorInvokeJSArray' code path
var result = Runtime.InvokeJSArray<string>(out var exceptionMessage, "evaluateJsExpression", expression, null, null); var result = Runtime.BlazorInvokeJSArray<string>(out var exceptionMessage, "evaluateJsExpression", expression, null, null);
if (exceptionMessage != null) if (exceptionMessage != null)
{ {
return $".NET got exception: {exceptionMessage}"; return $".NET got exception: {exceptionMessage}";
@ -44,9 +44,9 @@ namespace MonoSanityClient
public static string CallJsNoBoxing(int numberA, int numberB) public static string CallJsNoBoxing(int numberA, int numberB)
{ {
// For tests that call this method, we'll exercise the 'InvokeJS' code path // For tests that call this method, we'll exercise the 'BlazorInvokeJS' code path
// since that doesn't box the params // since that doesn't box the params
var result = Runtime.InvokeJS<int, int, object, int>(out var exceptionMessage, "divideNumbersUnmarshalled", numberA, numberB, null); var result = Runtime.BlazorInvokeJS<int, int, object, int>(out var exceptionMessage, "divideNumbersUnmarshalled", numberA, numberB, null);
if (exceptionMessage != null) if (exceptionMessage != null)
{ {
return $".NET got exception: {exceptionMessage}"; return $".NET got exception: {exceptionMessage}";

View File

@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Interop
/// <returns>The result of the function invocation.</returns> /// <returns>The result of the function invocation.</returns>
public static TRes InvokeUnmarshalled<TRes>(string identifier, params object[] args) public static TRes InvokeUnmarshalled<TRes>(string identifier, params object[] args)
{ {
var result = Runtime.InvokeJSArray<TRes>(out var exception, identifier, args); var result = Runtime.BlazorInvokeJSArray<TRes>(out var exception, identifier, args);
return exception != null return exception != null
? throw new JavaScriptException(exception) ? throw new JavaScriptException(exception)
: result; : result;
@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Blazor.Browser.Interop
/// <returns>The result of the function invocation.</returns> /// <returns>The result of the function invocation.</returns>
public static TRes InvokeUnmarshalled<T0, T1, T2, TRes>(string identifier, T0 arg0, T1 arg1, T2 arg2) public static TRes InvokeUnmarshalled<T0, T1, T2, TRes>(string identifier, T0 arg0, T1 arg1, T2 arg2)
{ {
var result = Runtime.InvokeJS<T0, T1, T2, TRes>(out var exception, identifier, arg0, arg1, arg2); var result = Runtime.BlazorInvokeJS<T0, T1, T2, TRes>(out var exception, identifier, arg0, arg1, arg2);
return exception != null return exception != null
? throw new JavaScriptException(exception) ? throw new JavaScriptException(exception)
: result; : result;

View File

@ -11,9 +11,9 @@ namespace WebAssembly
// driver.c in the Mono distribution // driver.c in the Mono distribution
[MethodImpl(MethodImplOptions.InternalCall)] [MethodImpl(MethodImplOptions.InternalCall)]
public static extern TRes InvokeJS<T0, T1, T2, TRes>(out string exception, string funcName, T0 arg0, T1 arg1, T2 arg2); public static extern TRes BlazorInvokeJS<T0, T1, T2, TRes>(out string exception, string funcName, T0 arg0, T1 arg1, T2 arg2);
[MethodImpl(MethodImplOptions.InternalCall)] [MethodImpl(MethodImplOptions.InternalCall)]
public static extern TRes InvokeJSArray<TRes>(out string exception, string funcName, params object[] args); public static extern TRes BlazorInvokeJSArray<TRes>(out string exception, string funcName, params object[] args);
} }
} }