>>Then we can still use words that got reserved in ES5.
>>In ES3, they aren't reserved so everything goes well and in ES5, they
>>are allowed to be used that way.
Wait...what? If I'm understanding your summation correctly you have it
wrong. They are reserved in ES3, and most/all ES3 browsers will throw errors
if you try to use a reserved word as a propertyName in identifier form (ie
dot-notation).

var o = {delete:true}
//This will throw an unrecoverable error in ES3 browsers
To be clear. Until all the ES3 browsers are deprecated, you should not use
reserved words as identifiers (function declarations, variable declarations,
propertyName using dot-notation). When ES5 is the standard you will be able
to use a reserved word as propertyName with dot and bracket notation, right
now you can only use bracket-notation. You will *not* be able to use
reserved words in ES5 for variable declarations and function declarations.
See my post above.

On Mon, Aug 29, 2011 at 9:35 AM, Xavier MONTILLET
<[email protected]>wrote:

> Then we can still use words that got reserved in ES5.
> In ES3, they aren't reserved so everything goes well and in ES5, they
> are allowed to be used that way.
>
> On Mon, Aug 29, 2011 at 6:01 PM, Lasse Reichstein
> <[email protected]> wrote:
> >
> >
> > On Sun, Aug 28, 2011 at 1:38 PM, Skateside <[email protected]> wrote:
> >>
> >> You can't use reserved words as variables or function names. You can
> >> use them as object properties, but only if they're passed in as a
> >> string (by wrapping them in quotation marks)
> >
> > Actually, in ES5, you can use them unquoted as keys in object literals
> and
> > in property access/
> >
> >>
> >> var o = {delete: true}; // causes an error because delete is a
> >> reserved word.
> >> o.delete; // same error as before.
> >
> > I.e., neither of these throw an error in ES5 (which is in all current
> > version browsers).
> >
> >>
> >> var o = {"delete": true}; // fine.
> >> o['delete']; // true
> >
> > That's still allowed too.
> >  /L
> >
> > --
> > To view archived discussions from the original JSMentors Mailman list:
> > http://www.mail-archive.com/[email protected]/
> >
> > To search via a non-Google archive, visit here:
> > http://www.mail-archive.com/[email protected]/
> >
> > To unsubscribe from this group, send email to
> > [email protected]
> >
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to