* JsonWriter.cs : write NaN, INF, -INF as JSON string, not JSON number.
Fixed bug #573691.
svn path=/trunk/mcs/; revision=152342
+2010-02-24 Atsushi Enomoto <atsushi@ximian.com>
+
+ * JsonWriter.cs : write NaN, INF, -INF as JSON string, not JSON number.
+ Fixed bug #573691.
+
2010-01-27 Atsushi Enomoto <atsushi@ximian.com>
* DataContractJsonSerializer.cs : KnownTypes does not include root
}
break;
case ElementType.Number:
+ // .NET is buggy here, it just outputs raw string, which results in invalid JSON format.
+ bool isString = false;
+ switch (text) {
+ case "INF":
+ case "-INF":
+ case "NaN":
+ isString = true;
+ break;
+ }
+ if (isString) {
+ element_kinds.Pop ();
+ element_kinds.Push (ElementType.String);
+ goto case ElementType.String;
+ }
+ break;
case ElementType.Boolean:
break;
default: