Closed kevinresol closed 4 years ago
Genes is bundled with a native js map implementation (without getId
): https://github.com/benmerckx/genes/blob/master/src/haxe/ds/ObjectMap.hx
The main reason for using the native javascript map was honestly because I didn't feel like dealing with the whole __map_reserved
thing. There's also https://github.com/HaxeFoundation/haxe/pull/8909 which is not available in the stable releases yet but will do away with getId
/assignId
as well.
ok I will patch in coconut instead
There's also HaxeFoundation/haxe#8909 which is not available in the stable releases yet but will do away with
getId
/assignId
as well.
I don’t think that PR gets rid of getId
/assignId
. Those functions only apply to ObjectMap
. That PR is for StringMap
which only supports string keys. That PR does support removing __map_reserved
when targeting ES5. However, since hasOwnProperty
is in ES3 I don’t get why they require ES5 for that…
getId
/assignId
could only be removed if targeting ES6 and reimplementing ObjectMap
in terms of ES6 Map
.
Sorry dunno how to write a title for this. This basically comes from a rather hackish piece of code:
This when compiled with Haxe, it is inlined into
key.__id__
but with genes it doesn't get inlined and remains
ObjectMap.getId
, causing runtime error because the fieldgetId
does not exist.cc @back2dos