Przeglądaj źródła

fixed subclass metadata lookup

Nicolas Cannasse 13 lat temu
rodzic
commit
a6e030f7c3
1 zmienionych plików z 6 dodań i 3 usunięć
  1. 6 3
      std/haxe/web/Dispatch.hx

+ 6 - 3
std/haxe/web/Dispatch.hx

@@ -215,9 +215,12 @@ class Dispatch {
 		case DRMeta(r):
 			loop(args, r);
 			var c = Type.getClass(cfg.obj);
-			if( c == null ) throw "assert";
-			var m = Reflect.field(haxe.rtti.Meta.getFields(c), name);
-			if( m == null ) throw "assert";
+			var m;
+			do {
+				if( c == null ) throw "assert";
+				m = Reflect.field(haxe.rtti.Meta.getFields(c), name);
+				c = Type.getSuperClass(c);
+			} while( m == null );
 			for( mv in Reflect.fields(m) )
 				onMeta(mv, Reflect.field(m, mv));
 		}