uneval() does not produce JSON
More playing with JSON and Spidermonkey has revealed yet another incredibly annoying fact (I hate those guys). Spidermonkey provides a lovely
uneval() function, that does the exact opposite of
eval() - turns JS objects into strings. It works on almost everything, and make life very very nice. There's also
Object.toSource() which does something similar (but not the same - try
But the strings that
' as a valid string delimiter. And guess what delimiter
uneval produces? Yay. So all the parsers are fine, and it's just SpiderMonkey that's broken.