瀏覽代碼

Fixed Json printing of Enum on static targets (cast Int to String)

Nicolas Cannasse 4 年之前
父節點
當前提交
537470a005
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      std/haxe/format/JsonPrinter.hx

+ 2 - 2
std/haxe/format/JsonPrinter.hx

@@ -128,8 +128,8 @@ class JsonPrinter {
 				} else
 					classString(v);
 			case TEnum(_):
-				var i:Dynamic = Type.enumIndex(v);
-				add(i);
+				var i = Type.enumIndex(v);
+				add(Std.string(i));
 			case TBool:
 				add(#if (php || jvm || hl) (v ? 'true' : 'false') #else v #end);
 			case TNull: