فهرست منبع

Lua : Reflect.hx fixes

There was still some old js code in here.  I'm replace it with lua
equivalents.
Justin Donaldson 10 سال پیش
والد
کامیت
48f9bf7e77
1فایلهای تغییر یافته به همراه1 افزوده شده و 6 حذف شده
  1. 1 6
      std/lua/_std/Reflect.hx

+ 1 - 6
std/lua/_std/Reflect.hx

@@ -49,12 +49,7 @@
 
 	public static function fields( o : Dynamic ) : Array<String> {
 		var a = [];
-		if (o != null) untyped {
-			var hasOwnProperty = __js__('Object').prototype.hasOwnProperty;
-			__js__("for( var f in o ) {");
-			if( f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o, f) ) a.push(f);
-			__js__("}");
-		}
+		untyped __lua__("for i,v in pairs(o) do a:push(i) end");
 		return a;
 	}