Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset all values created in arena #40

Open
tim-field opened this issue Jul 31, 2024 · 0 comments
Open

Unset all values created in arena #40

tim-field opened this issue Jul 31, 2024 · 0 comments

Comments

@tim-field
Copy link

tim-field commented Jul 31, 2024

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 expecting 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.

@tim-field tim-field changed the title Unset all objects created in arena Unset all values created in arena Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant