Jelajahi Sumber

Lua: fix some type methods... plus another milestone.

This commit patches up some methods responsible for retrieving class
information from types.

Fixing this allows the test to execute to completion.  Of course, the
tests fail, but at least we get the message indicating the cause for the
failure now :)
Justin Donaldson 10 tahun lalu
induk
melakukan
c7a5e90e82
1 mengubah file dengan 3 tambahan dan 5 penghapusan
  1. 3 5
      std/lua/_std/Type.hx

+ 3 - 5
std/lua/_std/Type.hx

@@ -51,10 +51,8 @@ enum ValueType {
 
 
 	public static function getClassName( c : Class<Dynamic> ) : String {
-		var a : Array<String> = untyped c.__name__;
-		if (a == null)
-			return null;
-		return a.join(".");
+		if (untyped c.__name__ == null) return null;
+		return lua.TableTools.concat(untyped c.__name__,'.');
 	}
 
 	public static function getEnumName( e : Enum<Dynamic> ) : String {
@@ -131,7 +129,7 @@ enum ValueType {
 
 	public static function getInstanceFields( c : Class<Dynamic> ) : Array<String> {
 		var a = [];
-		untyped __lua__("for i,v in c.mt do a:push(v) end");
+		untyped __lua__("for i,v in pairs(c.prototype) do a:push(v) end");
 		a.remove("__class__");
 		a.remove("__properties__");
 		return a;