From b452eed0b750c7246bf1524434c5ee4222ee1959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= <25794892+barisyild@users.noreply.github.com> Date: Sat, 4 Jan 2025 00:51:59 +0300 Subject: [PATCH] Fix JsonPrinter Int64 Type --- std/haxe/format/JsonPrinter.hx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/std/haxe/format/JsonPrinter.hx b/std/haxe/format/JsonPrinter.hx index 20cd597cd93..7d7792c4bfb 100644 --- a/std/haxe/format/JsonPrinter.hx +++ b/std/haxe/format/JsonPrinter.hx @@ -83,7 +83,12 @@ class JsonPrinter { v = replacer(k, v); switch (Type.typeof(v)) { case TUnknown: - add('"???"'); + #if hl + if(haxe.Int64.isInt64(v)) + add(haxe.Int64.toStr(v)); + else + #end + add('"???"'); case TObject: objString(v); case TInt: @@ -125,7 +130,9 @@ class JsonPrinter { } else if (c == Date) { var v:Date = v; quote(v.toString()); - } else + } else if(haxe.Int64.isInt64(v)) + add(haxe.Int64.toStr(v)); + else classString(v); case TEnum(_): var i = Type.enumIndex(v);