Refactoring
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user