Selaa lähdekoodia

Lua: Fix Type.typeof

Justin Donaldson 10 vuotta sitten
vanhempi
commit
78d1f4fe4e
1 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 2 4
      std/lua/_std/Type.hx

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

@@ -156,7 +156,7 @@ enum ValueType {
 	}
 
 	public static function typeof( v : Dynamic ) : ValueType untyped {
-		switch( __js__("typeof")(v) ) {
+		switch( __lua__("type")(v) ) {
 		case "boolean": return TBool;
 		case "string": return TClass(String);
 		case "number":
@@ -164,7 +164,7 @@ enum ValueType {
 			if( Math.ceil(v) == v%2147483648.0 )
 				return TInt;
 			return TFloat;
-		case "object":
+		case "table":
 			if( v == null )
 				return TNull;
 			var e = v.__enum__;
@@ -178,8 +178,6 @@ enum ValueType {
 			if( lua.Boot.isClass(v) || lua.Boot.isEnum(v) )
 				return TObject;
 			return TFunction;
-		case "undefined":
-			return TNull;
 		default:
 			return TUnknown;
 		}