diff --git a/src/Microsoft.Blazor.Browser.JS/src/Platform/Mono/MonoPlatform.ts b/src/Microsoft.Blazor.Browser.JS/src/Platform/Mono/MonoPlatform.ts index 90bb87b8ed..1a37ccd00f 100644 --- a/src/Microsoft.Blazor.Browser.JS/src/Platform/Mono/MonoPlatform.ts +++ b/src/Microsoft.Blazor.Browser.JS/src/Platform/Mono/MonoPlatform.ts @@ -86,10 +86,6 @@ export const monoPlatform: Platform = { //FIXME this is wastefull, we could remove the temp malloc by going the UTF16 route //FIXME this is unsafe, cuz raw objects could be GC'd. - if (!managedString) { - return null; - } - const utf8 = mono_string_get_utf8(managedString); const res = Module.UTF8ToString(utf8); Module._free(utf8 as any); @@ -141,7 +137,7 @@ function addScriptTagsToDocument() { document.write(``); } -function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: () => void, onError: (reason: any) => void) { +function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: () => void, onError: (reason?: any) => void) { const module = {} as typeof Module; module.print = line => console.log(`WASM: ${line}`); @@ -163,7 +159,7 @@ function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: () Module.FS_createPath('/', 'appBinDir', true, true); loadAssemblyUrls.forEach(url => - FS.createPreloadedFile('appBinDir', `${getAssemblyNameFromUrl(url)}.dll`, url, true, false, null, onError)); + FS.createPreloadedFile('appBinDir', `${getAssemblyNameFromUrl(url)}.dll`, url, true, false, undefined, onError)); }); module.postRun.push(() => { diff --git a/src/Microsoft.Blazor.Browser.JS/src/Platform/Platform.ts b/src/Microsoft.Blazor.Browser.JS/src/Platform/Platform.ts index 958f023bc5..8f4b610504 100644 --- a/src/Microsoft.Blazor.Browser.JS/src/Platform/Platform.ts +++ b/src/Microsoft.Blazor.Browser.JS/src/Platform/Platform.ts @@ -3,7 +3,7 @@ callEntryPoint(assemblyName: string, args: System_Object[]); findMethod(assemblyName: string, namespace: string, className: string, methodName: string): MethodHandle; - callMethod(method: MethodHandle, target: System_Object, args: System_Object[]): System_Object; + callMethod(method: MethodHandle, target: System_Object | null, args: System_Object[]): System_Object; toJavaScriptString(dotNetString: System_String): string; toDotNetString(javaScriptString: string): System_String; diff --git a/src/Microsoft.Blazor.Browser.JS/src/Rendering/Renderer.ts b/src/Microsoft.Blazor.Browser.JS/src/Rendering/Renderer.ts index fa4b1fa9e1..911b573fe9 100644 --- a/src/Microsoft.Blazor.Browser.JS/src/Rendering/Renderer.ts +++ b/src/Microsoft.Blazor.Browser.JS/src/Rendering/Renderer.ts @@ -173,7 +173,7 @@ function insertText(intoDomElement: Element, textNode: RenderTreeNodePointer) { } function clearElement(element: Element) { - let childNode: Node; + let childNode: Node | null; while (childNode = element.firstChild) { element.removeChild(childNode); } diff --git a/src/Microsoft.Blazor.Browser.JS/tsconfig.json b/src/Microsoft.Blazor.Browser.JS/tsconfig.json index 14d18afd91..9bf855f747 100644 --- a/src/Microsoft.Blazor.Browser.JS/tsconfig.json +++ b/src/Microsoft.Blazor.Browser.JS/tsconfig.json @@ -5,7 +5,8 @@ "removeComments": false, "sourceMap": true, "target": "es5", - "lib": ["es2015", "dom"] + "lib": ["es2015", "dom"], + "strict": true }, "exclude": [ "node_modules",