Run only once

This commit is contained in:
Adria Navarro 2024-01-31 12:41:34 +01:00
parent 623b4f5dab
commit 60dc6822cf
1 changed files with 3 additions and 1 deletions

View File

@ -105,8 +105,10 @@ export function init() {
}
}
// We need to warp up the actual run in a `cb` function to be able to extract its value from isolated-vm
js = js.replace(/run\(\);$/, "cb(run());")
const script = jsIsolate.compileModuleSync(
`import helpers from "compiled_module";${js};cb(run());`,
`import helpers from "compiled_module";${js}`,
{}
)