Skip to content

Unset all values created in arena #40

@tim-field

Description

@tim-field

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions