From 282a3ee3b943c1d9e8e4a82b3ca56b69e18c67ca Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 19 Feb 2024 19:58:41 +0100 Subject: [PATCH] Fix test --- packages/server/src/api/controllers/script.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/script.ts b/packages/server/src/api/controllers/script.ts index 7b07b97ba9..9a404da9fb 100644 --- a/packages/server/src/api/controllers/script.ts +++ b/packages/server/src/api/controllers/script.ts @@ -4,7 +4,8 @@ import { IsolatedVM } from "../../jsRunner/vm" export async function execute(ctx: Ctx) { const { script, context } = ctx.request.body const runner = new IsolatedVM(context) - const result = runner.execute(script) + + const result = runner.execute(`(function(){\n${script}\n})();`) ctx.body = result }