-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Description
These three examples all raise JSON parsing exceptions:
JSJsonParser parse: (Float infinity asJson).
JSJsonParser parse: ((Float infinity * -1) asJson).
JSJsonParser parse: (Float nan asJson).
There is no way to represent these Float values as-is in JSON. The stringify
function in the JSON object specified in ECMA-262 section 15.12.3 simply
outputs them as “null”, as explained in Note 4 in that section: “Finite
numbers are stringified as if by calling ToString(number). NaN and Infinity
regardless of sign are represented as the String null.” See
http://ecma-international.org/ecma-262/5.1/#sec-15.12.3
Original issue reported on code.google.com by [email protected]
on 8 Jun 2012 at 9:55