-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
import jsffi
var a = JsAssoc[cstring, int]{a: 2}
for z, b in a:
echo b
proc f =
var a = JsAssoc[cstring, int]{a: 2}
for z, b in a:
echo b
f()when a is global, it's a "fat pointer": so it's an array with one element which is the actual object.
However the for loop is for (.. in a_) so it iterates through the array instead through it's [0].
If it's in a function, it works correctly, but because for some reason a is just the object instead of a fat pointer (which I am not sure why)