2022-03-07 09:21:02 +00:00
|
|
|
declare global {
|
2022-03-24 09:48:56 +00:00
|
|
|
function syscall(name: string, ...args: any[]): Promise<any>;
|
2022-03-14 09:07:38 +00:00
|
|
|
}
|
|
|
|
|
2022-07-04 07:34:11 +00:00
|
|
|
// This is the case when running tests only, so giving it a dummy syscall function
|
|
|
|
if (typeof self === "undefined") {
|
2022-10-10 12:50:21 +00:00
|
|
|
// @ts-ignore: test
|
|
|
|
// deno-lint-ignore no-global-assign
|
2022-07-04 07:34:11 +00:00
|
|
|
self = {
|
2022-10-10 12:50:21 +00:00
|
|
|
syscall: () => {
|
2022-07-04 07:34:11 +00:00
|
|
|
throw new Error("Not implemented here");
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-03-24 09:48:56 +00:00
|
|
|
export const syscall = self.syscall;
|