1
0
Fork 0
mirror of synced 2024-09-30 17:18:14 +13:00
This commit is contained in:
Adria Navarro 2024-02-19 20:12:46 +01:00
parent 93fd5a2da5
commit 2042a95805

View file

@ -3,7 +3,7 @@ import { IsolatedVM } from "../../jsRunner/vm"
export async function execute(ctx: Ctx) { export async function execute(ctx: Ctx) {
const { script, context } = ctx.request.body const { script, context } = ctx.request.body
const runner = new IsolatedVM(context) const runner = new IsolatedVM().withContext(context)
const result = runner.execute(`(function(){\n${script}\n})();`) const result = runner.execute(`(function(){\n${script}\n})();`)
ctx.body = result ctx.body = result