Refactoring

This commit is contained in:
Zef Hemel
2022-03-24 10:48:56 +01:00
parent 09d07d587f
commit b51730d33f
8 changed files with 34 additions and 34 deletions
+2 -12
View File
@@ -1,15 +1,5 @@
declare global {
function syscall(id: number, name: string, args: any[]): Promise<any>;
var reqId: number;
function syscall(name: string, ...args: any[]): Promise<any>;
}
// This needs to be global, because this will be shared with all other functions in the same environment (worker-like)
if (typeof self.reqId === "undefined") {
self.reqId = 0;
}
export async function syscall(name: string, ...args: any[]): Promise<any> {
self.reqId++;
// console.log("Syscall", name, reqId);
return await self.syscall(self.reqId, name, args);
}
export const syscall = self.syscall;