Why can the solidus (/) be escaped?
ECMA-404: The JSON Data Interchange Format [pdf]
61–70 of 199 posts
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#62Earlier quoted context omitted.
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…
> you would break json parsing in all old version of IE Why do people still care about old versions of IE?
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#63Earlier quoted context omitted.
The slash and the solidus are two separate entities. I am not aware of any use of the actual solidus being used for escaping.
I am talking about BACKslash (REVERSE solidus). This says they are the same: http://en.wikipedia.org/wiki/Backslash
I can't imagine why they changed the name, given that the forward slash and the solidus are not interchangeable. http://www.fileformat.info/info/unicode/char/5c/index.htm
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#64My faint hopes for trailing comma support are now crushed.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#65Earlier quoted context omitted.
The ability to be lazy.
Doesn't seem like a good reason for a spec. Laziness is partly why Javascript as a language is so messed up.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#66The original json.js file from json.org had this copyright and license:
Copyright (c) 2005 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
http://web.archive.org/web/20060226161035/http://www.json.or...This was a standard MIT license with one change:
"This license uses the Expat [MIT] license as a base, but adds a clause mandating: “The Software shall be used for Good, not Evil.” This is a restriction on usage and thus conflicts with freedom 0. The restriction might be unenforcible [sic], but we cannot presume that. Thus, the license is nonfree."
http://www.gnu.org/licenses/license-list.html#JSON
However, the current versions of json.js and json2.js on GitHub contain only this public domain dedication and disclaimer:
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
https://github.com/douglascrockford/JSON-js/blob/master/json...So it's no longer an issue. You can feel free to use json2.js for good or evil.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#67Re: ECMA-404: The JSON Data Interchange Format [pdf]
#68Earlier quoted context omitted.
That's just a license for software available on json.org, so no impact at all.
Where is it on json.org? I can't seem to find it.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#69Earlier quoted context omitted.
For large code bases, you don't break git blame by adding in new arguments. And it's one less thing to think about when editing your code: always add a comma, never worry about errors because you need to add a comma to the line above.
This is why you prepend the comma before every succeeding item in a list or map.
Re: ECMA-404: The JSON Data Interchange Format [pdf]
#70Earlier quoted context omitted.
Doesn't seem like a good reason for a spec. Laziness is partly why Javascript as a language is so messed up.
If I could down-vote this lazy, drive-by, language bashing I would. Back up 'so messed up' or keep comments like this to yourself, they don't help the discussion.