haxe
haxe copied to clipboard
[regression][js] Std.is(_, Int) often not optimized
In haxe 4 these all used to be optimized, while in haxe 5 it only seems to work for Dynamic:
function main() {
var v:Dynamic = 0;
trace(Std.is(v, Int)); // typeof(v) == "number" && ((v | 0) === v)
var v:Any = v;
trace(Std.is(v, Int)); // js_Boot.__instanceof(v1,Int)
var v:Int = v;
trace(Std.is(v, Int)); // js_Boot.__instanceof(v1,Int)
}
Also checking against Float seems to always work.