Parcourir la source

Lua: Misc tweaks and improvements to Reflect and Type.

Justin Donaldson il y a 10 ans
Parent
commit
8b60987809
2 fichiers modifiés avec 2 ajouts et 3 suppressions
  1. 1 1
      std/lua/_std/Reflect.hx
  2. 1 2
      std/lua/_std/Type.hx

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

@@ -87,7 +87,7 @@
 
 	public static function deleteField( o : Dynamic, field : String ) : Bool untyped {
 		if( !hasField(o,field) ) return false;
-		__js__("delete")(o[field]);
+		o[field] = null;
 		return true;
 	}
 

+ 1 - 2
std/lua/_std/Type.hx

@@ -131,9 +131,8 @@ enum ValueType {
 		var p = untyped c.prototype;
 		var a = [];
 		while (p != null){
-			a = a.concat(Reflect.fields(untyped c.prototype));
+			for (f in Reflect.fields(p)) a.push(f);
 			p = untyped p.prototype;
-
 		}
 		a.remove("__class__");
 		a.remove("__properties__");