소스 검색

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 {
-		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;