3 ms·
At least it doesn't copy the JSON's braindead idea to rule out NaNs and Infs...
by mbq 13y ago
At least it doesn't copy the JSON's braindead idea to rule out NaNs and Infs...
- angersock 13y agoWait, what? I hadn't heard about that. Whatfuck?
- mbq 13y agoSee: http://stackoverflow.com/questions/1423081/json-left-out-infinity-and-nan-json-status-in-ecmascript http://stackoverflow.com/questions/1423081/json-left-out-inf... In short, this is because JS does not treat NaN and Infinity as numerical constants but as pre-defined, mutable variables; this way backward-compatible parsing of hypothetical sane JSON with eval would be vulnerable to injection. Nevertheless, many JSON codecs have their own idea what to do with it, so this stuff can get really nasty.