Hello
I'm using the latest Haxe 3.4.0 and compiling into js.
I'm encountering a very weird bug when doing a simple condition like so:
var indexFrom:UInt = 2;
var indexTo:UInt = 0;
js.Browser.console.log(indexFrom < indexTo - 1);
is compiled into:
window.console.log(_$UInt_UInt_$Impl_$.gt(indexTo - 1,indexFrom));
which gives me "true" as a result. And it should be false (unless I'm missing something)...
the code of that function is:
_$UInt_UInt_$Impl_$.gt = function(a,b) {
var aNeg = a < 0;
var bNeg = b < 0;
if(aNeg != bNeg) {
return aNeg;
} else {
return a > b;
}
};
and it shows that when the sign of the two parameters are different, it returns the check on whether the first parameter is negative or not. Which, in my case, is wrong...
And why would a simple condition be compiled into a function call with such a complicated system ?
Maybe I'm doing something wrong.
Thanks.
Thomas.