Jengamon / ruwren

A Rustified binding for Wren
Other
40 stars 9 forks source link

get_map_count() returns inconsistent values #15

Closed darmie closed 1 year ago

darmie commented 1 year ago

Each time I call vm.get_map_count() I get random number like Some(712005920) but I am expecting 1 as value, because the value is expected to be {"sum": 3}

I have a wren class like this

class Component {
    static process(input){
        if(input["left"] != null && input["right"] != null){
            var sum = input["left"] + input["right"]
            var result = {"sum": sum}
            my_foreign_api.send(result) // send result to rust backend
        }
    }
}
 fn send(vm: &VM) {
       let count = vm.get_map_count();
       println!("{:?}", count); // <= I need to know the size of the map
}
Jengamon commented 1 year ago

Merged your fix in #16