quickjs-emscripten-sync
quickjs-emscripten-sync copied to clipboard
Unset all values created in arena
Currently a call to arena dispose doesn't remove variables from the context.
const arena1 = new Arena(vm, {
isMarshalable: 'json'
})
arena1.expose({foo: 'bar'})
arena1.evalCode(`return foo`) // returns bar as expect
arena1.dispose()
const arena2 = new Arena(vm, {
isMarshalable: 'json'
})
// I wasn't existing this to work after the dispose above
arena2.evalCode(`return foo`) // returns 'bar' unexpected
Is it possible to reset the arena? I'd like to share context between executions, as we apply polyfills to the run time, this takes a long time so I was trying to share the context between a few different evaluations.