Salient Solutions

wrasslin ones and nones for fun and profit - Sky Sanders' Blog
posts - 96, comments - 70, trackbacks - 0

Sunday, October 17, 2010

people say 'native JSON implementations considered dangerous'

ok, so I said it.

 

After spending 8 hours trying to figure out why some fairly complex but carefully crafted and instrumented javascript code was working on in all browsers (including chrome) except Safari, I stumbled across another native JSON bug.

Safari JSON coult not serialize a simple object that json2.js (and most other browser's native stringify) has no problem with, throws and kills the script.

I will likely break the case out and submit a bug but...

Sky Sanders says

"Forget the sunscreen, if you remember anything I have ever said, remember that considering the inconsistency and presence of confirmed bugs in multiple browser native JSON implementations, when less than trivial JSON functionality is required, include json2.js and remove the polite check at the top, forcing an overwrite of .stringify and .parse."

 

 

posted @ Sunday, October 17, 2010 6:05 AM | Feedback (0) |

Powered by: