Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Mar 1, 2024
1 parent 00e918b commit 126d5f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 52 deletions.
9 changes: 0 additions & 9 deletions haxe/ui/macros/Macros.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Array<Field>> = new Map<String, Array<Field>>();
#end
static function buildBehaviours():Array<Field> {
if (Context.getLocalClass().get().isExtern) {
return null;
Expand Down Expand Up @@ -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
Expand Down
45 changes: 2 additions & 43 deletions haxe/ui/macros/helpers/ClassBuilder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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<FieldBuilder> {
var fs = [];
Expand Down

0 comments on commit 126d5f3

Please sign in to comment.