Enable TypeScript strict mode
This commit is contained in:
parent
34d3eb5b72
commit
7bbf2b54aa
|
|
@ -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 wastefull, we could remove the temp malloc by going the UTF16 route
|
||||||
//FIXME this is unsafe, cuz raw objects could be GC'd.
|
//FIXME this is unsafe, cuz raw objects could be GC'd.
|
||||||
|
|
||||||
if (!managedString) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const utf8 = mono_string_get_utf8(managedString);
|
const utf8 = mono_string_get_utf8(managedString);
|
||||||
const res = Module.UTF8ToString(utf8);
|
const res = Module.UTF8ToString(utf8);
|
||||||
Module._free(utf8 as any);
|
Module._free(utf8 as any);
|
||||||
|
|
@ -141,7 +137,7 @@ function addScriptTagsToDocument() {
|
||||||
document.write(`<script defer src="${monoRuntimeScriptUrl}"></script>`);
|
document.write(`<script defer src="${monoRuntimeScriptUrl}"></script>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
const module = {} as typeof Module;
|
||||||
|
|
||||||
module.print = line => console.log(`WASM: ${line}`);
|
module.print = line => console.log(`WASM: ${line}`);
|
||||||
|
|
@ -163,7 +159,7 @@ function createEmscriptenModuleInstance(loadAssemblyUrls: string[], onReady: ()
|
||||||
|
|
||||||
Module.FS_createPath('/', 'appBinDir', true, true);
|
Module.FS_createPath('/', 'appBinDir', true, true);
|
||||||
loadAssemblyUrls.forEach(url =>
|
loadAssemblyUrls.forEach(url =>
|
||||||
FS.createPreloadedFile('appBinDir', `${getAssemblyNameFromUrl(url)}.dll`, url, true, false, null, <any>onError));
|
FS.createPreloadedFile('appBinDir', `${getAssemblyNameFromUrl(url)}.dll`, url, true, false, undefined, onError));
|
||||||
});
|
});
|
||||||
|
|
||||||
module.postRun.push(() => {
|
module.postRun.push(() => {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
callEntryPoint(assemblyName: string, args: System_Object[]);
|
callEntryPoint(assemblyName: string, args: System_Object[]);
|
||||||
findMethod(assemblyName: string, namespace: string, className: string, methodName: string): MethodHandle;
|
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;
|
toJavaScriptString(dotNetString: System_String): string;
|
||||||
toDotNetString(javaScriptString: string): System_String;
|
toDotNetString(javaScriptString: string): System_String;
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ function insertText(intoDomElement: Element, textNode: RenderTreeNodePointer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearElement(element: Element) {
|
function clearElement(element: Element) {
|
||||||
let childNode: Node;
|
let childNode: Node | null;
|
||||||
while (childNode = element.firstChild) {
|
while (childNode = element.firstChild) {
|
||||||
element.removeChild(childNode);
|
element.removeChild(childNode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
"removeComments": false,
|
"removeComments": false,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"lib": ["es2015", "dom"]
|
"lib": ["es2015", "dom"],
|
||||||
|
"strict": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue