hasOwnProperty vs methods - html5 target


#1

Hello.

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]

Do I miss something? Could you please advice.


#2

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.

Look into https://api.haxe.org/Type.html and https://api.haxe.org/Reflect.html, specifically Reflect.hasField