FW: Unicode Escape sequences for keywords, what's the correct behaviour?

# BelleveInvis (12 years ago)

If a keyword represented as unicode escape sequences, should it interpreted as identifier or keyword?

Example code:

\u0076\u0061\u0072 a

Should it throw a syntax error?

# Andreas Rossberg (12 years ago)

On 21 March 2013 11:04, BelleveInvis <infinte.cdda at hotmail.com> wrote:

If a keyword represented as unicode escape sequences, should it interpreted as identifier or keyword?

Example code:

\u0076\u0061\u0072 a

Should it throw a syntax error?

Not entirely clear. There is a bug for it:

ecmascript#277

# gaz Heyes (12 years ago)

On 21 March 2013 10:04, BelleveInvis <infinte.cdda at hotmail.com> wrote:

If a keyword represented as unicode escape sequences, should it interpreted as identifier or keyword?

Example code:

\u0076\u0061\u0072 a

Should it throw a syntax error?

Get even more confusing when you assign to it :D tru\u0065=1

# Allen Wirfs-Brock (12 years ago)

As a keyword.

This is clarified in the ES6 draft (people.mozilla.org/~jorendorff/es6-draft.html#sec-7.6.1 )

# BelleveInvis (12 years ago)

Subject: Re: Unicode Escape sequences for keywords, what's the correct behaviour? From: allen at wirfs-brock.com Date: Thu, 21 Mar 2013 08:41:35 -0700 CC: es-discuss at mozilla.org To: infinte.cdda at hotmail.com

As a keyword.

This is clarified in the ES6 draft (people.mozilla.org/~jorendorff/es6-draft.html#sec-7.6.1 )

Allen

On Mar 21, 2013, at 3:04 AM, BelleveInvis wrote:

If a keyword represented as unicode escape sequences, should it interpreted as identifier or keyword?

Example code:

\u0076\u0061\u0072 a

Should it throw a syntax error?


es-discuss mailing list es-discuss at mozilla.org<mailto:es-discuss at mozilla.org> mail.mozilla.org/listinfo/es-discuss

However I detected some weird implementations.

In Chrome 25, \u0076\u0061\u0072 a throws a syntax error, means that Chrome treat escape sequences as identifier. Though IE10 runs \u0076\u0061\u0072 a well, shows that it treat \u0076\u0061\u0072 a keyword. Hmmmmmmm, perhaps I should establish an issue for Chrome.

# BelleveInvis (12 years ago)

Hmmmmm, Maybe I should establish an issue for Chrome, instead of IE. Thanks.

Subject: Re: Unicode Escape sequences for keywords, what's the correct behaviour? From: allen at wirfs-brock.com Date: Thu, 21 Mar 2013 08:41:35 -0700 CC: es-discuss at mozilla.org To: infinte.cdda at hotmail.com

As a keyword. This is clarified in the ES6 draft (people.mozilla.org/~jorendorff/es6-draft.html#sec-7.6.1 )

Allen

On Mar 21, 2013, at 3:04 AM, BelleveInvis wrote:If a keyword represented as unicode escape sequences, should it interpreted as identifier or keyword?

Example code:

\u0076\u0061\u0072 a

Should it throw a syntax error?