Browse Source

Lua: Enums should not be treated as Arrays in Boot.printEnum

Justin Donaldson 9 years ago
parent
commit
f18db7fb99
1 changed files with 3 additions and 1 deletions
  1. 3 1
      std/lua/Boot.hx

+ 3 - 1
std/lua/Boot.hx

@@ -173,9 +173,11 @@ class Boot {
 	}
 
 	static function printEnum(o:Table<Int,Dynamic>, s : String){
-		if (!Std.is(o, Array)){
+		if (!inheritsFrom(o,Array)){
+			// non-parameterized enums are simple table values
 			return o[0];
 		} else {
+			// parameterized enums are arrays
 			var o2 : Array<Dynamic> = cast o;
 			var str = o[0] + "(";
 			s += "\t";