> >        // YUI compressor won't compress if you have no 
> >        // quotes on keywords
> >        float: function() {
> >                alert("float");
> >        },
> >        int: function(){
> >                alert("int");
> >        }
> > }
> >
> > a.float();
> > a.int();
> 
> int and float are reserved words as well. Technically, you 
> are supposed to quote all keys (JSON), but in reality you 
> only need to quote the reserved ones. "default" gets me every time.

This isn't JSON, it's a JavaScript object literal, so the quotes are not
required if the property name is a legal identifier. If it were JSON, then
the alert() calls wouldn't be allowed either.

-Mike

Reply via email to