diff --git a/haxe/ui/macros/Macros.hx b/haxe/ui/macros/Macros.hx index dac7d93b0..974eae57d 100644 --- a/haxe/ui/macros/Macros.hx +++ b/haxe/ui/macros/Macros.hx @@ -532,10 +532,6 @@ class Macros { #end } - #if ((haxe_ver < 4) || haxeui_heaps) - // TODO: this is a really ugly haxe3 hack / workaround - once haxe4 stabalises this *MUST* be removed - its likely brittle and ill conceived! - public static var _cachedFields:Map> = new Map>(); - #end static function buildBehaviours():Array { if (Context.getLocalClass().get().isExtern) { return null; @@ -823,11 +819,6 @@ class Macros { buildClonable(builder); } - #if ((haxe_ver < 4) || haxeui_heaps) - // TODO: this is a really ugly haxe3 hack / workaround - once haxe4 stabalises this *MUST* be removed - its likely brittle and ill conceived! - _cachedFields.set(builder.fullPath, builder.fields); - #end - RTTI.save(); #if haxeui_macro_times diff --git a/haxe/ui/macros/helpers/ClassBuilder.hx b/haxe/ui/macros/helpers/ClassBuilder.hx index 91fdb3a98..a7a9a5f3d 100644 --- a/haxe/ui/macros/helpers/ClassBuilder.hx +++ b/haxe/ui/macros/helpers/ClassBuilder.hx @@ -203,16 +203,7 @@ class ClassBuilder { return false; } if (recursive == true) { - #if (haxe_ver < 4) - // TODO: this is a really ugly haxe3 hack / workaround - once haxe4 stabalises this *MUST* be removed - its likely brittle and ill conceived! - if (findField(name) != null) { - return true; - } - return (haxe3FindField(classType, name) != null); - #else - var r = (findFieldEx(classType, name) != null); - return r; - #end + return findFieldEx(classType, name) != null; } return (findField(name) != null); } @@ -222,40 +213,8 @@ class ClassBuilder { return false; } var superClassType = classType.superClass.t.get(); - #if (haxe_ver < 4) - // TODO: this is a really ugly haxe3 hack / workaround - once haxe4 stabalises this *MUST* be removed - its likely brittle and ill conceived! - if (findField(name) != null) { - return true; - } - return (haxe3FindField(superClassType, name) != null); - #else - var r = (findFieldEx(superClassType, name) != null); - #end - return r; - } - - #if (haxe_ver < 4) - // TODO: this is a really ugly haxe3 hack / workaround - once haxe4 stabalises this *MUST* be removed - its likely brittle and ill conceived! - private function haxe3FindField(c:ClassType, name:String) { - var fullPath = c.pack.join(".") + "." + c.name; - var fields = Macros._cachedFields.get(fullPath); - var field = null; - if (fields != null) { - for (f in fields) { - if (f.name == name) { - field = f; - break; - } - } - } - - if (field == null && c.superClass != null) { - field = haxe3FindField(c.superClass.t.get(), name); - } - - return field; + return findFieldEx(superClassType, name) != null; } - #end public function getFieldsWithMeta(meta:String):Array { var fs = [];