From 3d34ad6feae694b2387061c760d7ed82df1c0267 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 19 Aug 2023 10:48:17 +0700 Subject: [PATCH] ae --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4fb5edd..c7bdf14 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,8 @@ io.on('connection', (socket) => { let isFirst = true + let jsonArray + function reset () { worker = new Worker(path.join(__dirname, 'vm.js')) @@ -36,7 +38,9 @@ io.on('connection', (socket) => { reset() - socket.on('setFunctions', (jsonArray) => { + socket.on('setFunctions', (_jsonArray) => { + jsonArray = _jsonArray + worker.postMessage({ type: 'setFunctions', jsonArray }) })