I’ve noticed that hasOwnProperty() doesn’t work with methods (html5 target).
examle:
class My_class extends Sprite {
public var my_var:Int = 12;
public function my_function():Void{
}
}
var my_instance:My_class = new My_class();
my_instance.hasOwnProperty(my_var); // true
my_instance.hasOwnProperty(my_function); // false [HTML5] , true [Flash]
Haxe classes do not have hasOwnProperty, but openfl.utils.Object does. Are you using that class? If so, perhaps we need an additional improvement in the class.
I tested Haxe class as well as openfl.utils.Object. Unfortunately I received the same results with Reflect.hasField.
Some posts on the Haxe forum seem to confirm my thoughts - currently one cannot check if method exists [for HTML5 target] in other way than by error catching.