, UInt) js target not working?

We have some legacy code that uses UInt values. When converting over to a Haxe/JS project we found this does not give the correct response:

var uint:UInt = 1;
trace("should be true: " +, UInt));

Haxe 3.4.7

should be true: false

Haxe 4

Uncaught TypeError: Right-hand side of ‘instanceof’ is not callable

Is there another way to check for UInt? Maybe a class name comparison?

That’s not specific to the js target, UInt is an abstract over Int, and abstract aren’t there at runtime so you can’t use on them.

I don’t think there’s a specific way to find out if a type is an UInt at runtime,
why do you need to do this? There might be a way to do that at compile time.

Thanks for the response, what you say makes sense.

Our need is that we have a legacy Flash project that stores some binary UInt data to a file and we need to read/write in this format in Javascript and C#. We have found that using the Int data and writing out the bytes manually works. Essentially we ignore the UInt type at read and write time and only handle the Int type. The UInt abstract handles everything else we need during run time.

A macro would be able to handle the UInt detection at compile time and store the reflection details if needed, but it looks like we won’t be needing to go that far with this project.