I'm trying to cross compile an existing flash app written in haxe into javascript using openfl and haxe.
Under flash I can do the following:
class foo
{
var bar : Int;
public function new()
{
trace(bar); //under flash prints 0, under javascript undefined
}
}
When compiling to javascript instead of 0, i get Undefined.
My questions is can I either make the compile print warnings/error if a member variable is left uninitialized by the constructor.
Even better can I make haxe I make it so haxe will initialize them for me in js to 0.
Same story with Bool = false, Float = 0 etc, I haven't tested but probably with Object = null also.
The app has 144 classes, and over 20k lines of code. Finding and adding explicit initializers manually will take a ton of time, which is why I'm looking for alternatives.