No thanks to Mr. Crawford for not fixing the \u2028-9 issue. JSON as defined is not a subset of javascript. It is a design mistake that was pointed out to him years ago, but he is too stubborn or arrogant to fix it.
ECMA-404: The JSON Data Interchange Format [pdf]
31–40 of 199 posts
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#32What's so awesome about JSON? Its standard documentation is 5 pages. So simple, so awesome.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#33No thanks to Mr. Crawford for not fixing the \u2028-9 issue. JSON as defined is not a subset of javascript. It is a design mistake that was pointed out to him years ago, but he is too stubborn or arrogant to fix it.
Why do you ask him without the stubborn and arrogant comment on G+ and about trailing commas? Or is indirect better?
I have seen people write code like (mix javascript and some templating):
var prefs = ;
...
The above code looks okay, but if the json is just spec conforming, then you are exposed to a potential XSS attack.Most people that write json encoders are aware of the problem, but why publish a a spec that can potentially create serious security problems?
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#34Re: ECMA-404: The JSON Data Interchange Format [pdf]
#35Earlier quoted context omitted.
Why do you believe that using XML is better than JSON in every case? Or am I misinterpreting your comment?
I took it as sarcasm. The "for everything" was the tell.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#36They say JSON is not for binary and won't change. With a backslash (oops reverse solidus) you could send binary data - eg an image. { myimage: "\01\02\03" } of course, not efficient. You could base64-encode it and put that in a string. I think some syntax for binary would be useful - eg { myimage: 0x010203 }
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#37Earlier quoted context omitted.
Why do you ask him without the stubborn and arrogant comment on G+ and about trailing commas? Or is indirect better?
Probably because he's very aware of it already and people here may not be. (Meta: Why have any conversation on an HN back-channel when there are comments open at the source?)
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#38Earlier quoted context omitted.
Why do you ask him without the stubborn and arrogant comment on G+ and about trailing commas? Or is indirect better?
Trailing commas would make the problem worse! If you allow trailing commas then you would break json parsing in all old version of IE. The unicode line ending problem is more subtle. I have seen people write code like (mix javascript and some templating): var prefs = ; ... The above code looks okay, but if the json is just spec conforming, then you are exposed to a potential XSS attack. Most people that write json en…
Why do people still care about old versions of IE?