From 5a49fbf08898984e5c258c9f3ed17e6dfe6b560f Mon Sep 17 00:00:00 2001 From: xiezhuojin <37146118+xiezhuojin@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D#2543?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this中的global循环引用了 --- server/utils/sandbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils/sandbox.js b/server/utils/sandbox.js index 146dcc1d7..ce6841ca9 100644 --- a/server/utils/sandbox.js +++ b/server/utils/sandbox.js @@ -7,7 +7,7 @@ module.exports = async function sandboxFn(context, script) { asyncTimeout: 60000 }) - script += "; return this;"; + script += "; delete this.global; return this;"; // 执行动态代码 const result = await safeVm.run(script, context)