Skip to content

Possible to synchronize vm -> host -> vm? #4

Open
@emilmuller

Description

@emilmuller

Hi

I'm trying to compare objects which crosses from VM -> host -> VM. This seems to fail. See the example below. Is it possible to add support for this? :)

Kind regards, Emil

(async () => {
    const vm = (await getQuickJS()).createVm();
    const arena = new Arena(vm, { isMarshalable: true });

    function test(obj) {
        return obj;
    }

    arena.expose({ test });
    console.log(arena.evalCode(`let foo = {}; foo === test(foo)`)); // I want this to log 'true', but it logs 'false'

    arena.dispose();
    vm.dispose();
})();

Also, thanks for this great library! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions