Explorar o código

Preserve Float-typed values when they are written as such in JSON (ie. "5.0" or "0.0") (#9844)

Sébastien Bénard %!s(int64=5) %!d(string=hai) anos
pai
achega
e33713f2d2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      std/haxe/format/JsonParser.hx

+ 1 - 1
std/haxe/format/JsonParser.hx

@@ -302,7 +302,7 @@ class JsonParser {
 
 		var f = Std.parseFloat(str.substr(start, pos - start));
 		var i = Std.int(f);
-		return if (i == f) i else f;
+		return if (!point && i == f) i else f;
 	}
 
 	inline function nextChar() {