Parcourir la source

[lua] fix toString behavior in the case of -0 (fix #6652)

Justin Donaldson il y a 8 ans
Parent
commit
1a87a1e444
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      std/lua/Boot.hx

+ 1 - 0
std/lua/Boot.hx

@@ -182,6 +182,7 @@ class Boot {
 			case "number" : {
 			case "number" : {
 				if (o == std.Math.POSITIVE_INFINITY) "Infinity";
 				if (o == std.Math.POSITIVE_INFINITY) "Infinity";
 				else if (o == std.Math.NEGATIVE_INFINITY) "-Infinity";
 				else if (o == std.Math.NEGATIVE_INFINITY) "-Infinity";
+				else if (o == 0) "0";
 				else if (o != o) "NaN";
 				else if (o != o) "NaN";
 				else untyped tostring(o);
 				else untyped tostring(o);
 			}
 			}