Hacker News new | ask | show | jobs
by mbq 4613 days ago
At least it doesn't copy the JSON's braindead idea to rule out NaNs and Infs...
1 comments

Wait, what? I hadn't heard about that. Whatfuck?
See: 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.