Pseudo-JSON with unquoted property names

Dion Almaer dion at almaer.com
Fri Jun 5 14:17:20 PDT 2009


There key here being that 'class' is a keyword.

Personally having to quote things is frustrating if you think of JSON as not
a data format but something that developers tinker with. I am always getting
JSON "wrong" while I tinker in development, especially when an eval() is
around at some point and it works. It is a subtle developer ergonomic issue
vs. the safety that you get. I tend to be loose and am probably wrong on
this one.

On Fri, Jun 5, 2009 at 2:14 PM, Mike Shaver <mike.shaver at gmail.com> wrote:

> On Fri, Jun 5, 2009 at 4:57 PM, John Cowan <cowan at ccil.org> wrote:
> > However, { "class": "sophomore" } is valid ES3, whereas { class:
> "sophomore" } is not.
>
> Really?  I was pretty sure that ES3 permitted naked strings as
> property names in object initializers, but I'll admit I'm not going to
> walk through the grammar right now to be sure.
>
> Mike
> _______________________________________________
> es5-discuss mailing list
> es5-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es5-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090605/0d24f898/attachment.html>


More information about the es5-discuss mailing list