1
0
silverbullet/webapp/syscalls/system.ts
Zef Hemel 6ebf8e7f15 * Refactored server to use spaces
* Other cleanup
2022-04-08 17:46:09 +02:00

20 lines
463 B
TypeScript

import { SysCallMapping } from "../../plugos/system";
import { Space } from "../../common/spaces/space";
export function systemSyscalls(space: Space): SysCallMapping {
return {
"system.invokeFunction": async (
ctx,
env: string,
name: string,
...args: any[]
) => {
if (!ctx.plug) {
throw Error("No plug associated with context");
}
return space.invokeFunction(ctx.plug, env, name, args);
},
};
}