Browse Source

[as3] dodge JsonPrinter issue

Simon Krajewski 9 years ago
parent
commit
3ad2f04550
1 changed files with 2 additions and 2 deletions
  1. 2 2
      std/haxe/format/JsonPrinter.hx

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

@@ -82,7 +82,7 @@ class JsonPrinter {
 		case TObject:
 		case TObject:
 			objString(v);
 			objString(v);
 		case TInt:
 		case TInt:
-			add(v);
+			add(#if as3 Std.string(v) #else v #end);
 		case TFloat:
 		case TFloat:
 			add(Math.isFinite(v) ? v : 'null');
 			add(Math.isFinite(v) ? v : 'null');
 		case TFunction:
 		case TFunction:
@@ -129,7 +129,7 @@ class JsonPrinter {
 			var i : Dynamic = Type.enumIndex(v);
 			var i : Dynamic = Type.enumIndex(v);
 			add(i);
 			add(i);
 		case TBool:
 		case TBool:
-			add(#if php (v ? 'true' : 'false') #else v #end);
+			add(#if (php || as3) (v ? 'true' : 'false') #else v #end);
 		case TNull:
 		case TNull:
 			add('null');
 			add('null');
 		}
 		}