This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -26,10 +26,12 @@ import lua.Boot;
@:coreApi class Reflect {
public inline static function hasField(o:Dynamic, field:String):Bool {
if (Lua.type(o) == "string" && (untyped String.prototype[field] != null || field == "length")) {
return true;
return if (inline isFunction(o)) {
false;
} else if (Lua.type(o) == "string" && (untyped String.prototype[field] != null || field == "length")) {
true;
} else
return untyped o.__fields__ != null ? o.__fields__[field] != null : o[field] != null;
untyped o.__fields__ != null ? o.__fields__[field] != null : o[field] != null;
}
public static function field(o:Dynamic, field:String):Dynamic
@ -116,7 +118,7 @@ import lua.Boot;
untyped {
if (v == null)
return false;
var t = __lua__("type(v)");
var t = lua.Lua.type(v);
return (t == "string" || (t == "table" && v.__enum__ == null))
|| (t == "function" && (lua.Boot.isClass(v) || lua.Boot.isEnum(v)) != null);
}