ds icon indicating copy to clipboard operation
ds copied to clipboard

Array Bug in Hashlink target

Open darmie opened this issue 4 years ago • 1 comments

This line causes a problem https://github.com/polygonal/ds/blob/4b244ff89f6c3b4c1308dfdab923659a8db2abbf/src/ds/tools/NativeArrayTools.hx#L63

I fixed it this by removing the length setter for HL target...

#elseif hl
var a = [];
return a;
#else
var a = [];
untyped a.length = len;
return a;
#end

I didn't open a pull request because I haven't done extensive tests beyond my own use case, but please look into this cos it's breaking my library on HL target.

darmie avatar Jan 11 '22 15:01 darmie

There’s a PR for this issue. There, length is set with resize instead of not being set at all.

https://github.com/polygonal/ds/pull/53

justin-espedal avatar Jan 12 '22 01:01 justin-espedal