|
@@ -90,17 +90,14 @@ import lua.Boot;
|
|
|
}
|
|
|
|
|
|
public static function fields( o : Dynamic ) : Array<String> {
|
|
|
+ var ret = new Array<String>();
|
|
|
+ var fields = lua.Boot.hiddenFields;
|
|
|
if (untyped o.__fields__ != null) {
|
|
|
- return lua.PairTools.pairsFold(o.__fields__, function(a,b,c:Array<String>){
|
|
|
- if (Boot.hiddenFields.indexOf(a) == -1) c.push(a);
|
|
|
- return c;
|
|
|
- }, []);
|
|
|
+ untyped __lua__("for k,_ in pairs(o.__fields__) do if fields:indexOf(k) == -1 then ret:push(k) end end");
|
|
|
} else {
|
|
|
- return lua.PairTools.pairsFold(o, function(a,b,c:Array<String>){
|
|
|
- if (Boot.hiddenFields.indexOf(a) == -1) c.push(cast a);
|
|
|
- return c;
|
|
|
- }, []);
|
|
|
+ untyped __lua__("for k,_ in pairs(o) do if fields:indexOf(k) == -1 then ret:push(k) end end");
|
|
|
}
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
public static function isFunction( f : Dynamic ) : Bool {
|