square / PonyDebugger

Remote network and data debugging for your native iOS app using Chrome Developer Tools
Other
5.87k stars 595 forks source link

Invalid JSON generated with NSNumbers storing Inf/NaN #102

Closed KingOfBrian closed 10 years ago

KingOfBrian commented 10 years ago

I encountered an issue with the generated JSON sending values for infinity. The Standard for JSON states that NaN and [+-]Inf are not supported. Chrome appears to handle this fine, however many other JSON parsers are not happy with this and generate errors. This fixes the behavior by returning a string for the invalid number values. The behavior in the chrome debugger is identical, but the generated JSON is valid.