浏览代码

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 年之前
父节点
当前提交
c7a5e90e82
共有 1 个文件被更改,包括 3 次插入5 次删除
  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 {
 	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 {
 	public static function getEnumName( e : Enum<Dynamic> ) : String {
@@ -131,7 +129,7 @@ enum ValueType {
 
 
 	public static function getInstanceFields( c : Class<Dynamic> ) : Array<String> {
 	public static function getInstanceFields( c : Class<Dynamic> ) : Array<String> {
 		var a = [];
 		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("__class__");
 		a.remove("__properties__");
 		a.remove("__properties__");
 		return a;
 		return a;