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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

BelleveInvis
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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

Andreas Rossberg-4
On 21 March 2013 11:04, BelleveInvis <[hidden email]> 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:

https://bugs.ecmascript.org/show_bug.cgi?id=277

/Andreas
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

gaz Heyes
In reply to this post by BelleveInvis
On 21 March 2013 10:04, BelleveInvis <[hidden email]> 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

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

Allen Wirfs-Brock
In reply to this post by BelleveInvis
As a keyword.

This is clarified in the ES6 draft (http://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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

BelleveInvis
________________________________

> Subject: Re: Unicode Escape sequences for keywords, what's the correct
> behaviour?
> From: [hidden email]
> Date: Thu, 21 Mar 2013 08:41:35 -0700
> CC: [hidden email]
> To: [hidden email]
>
> As a keyword.
>
> This is clarified in the ES6 draft
> (http://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
> [hidden email]<mailto:[hidden email]>
> https://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.    
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

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

BelleveInvis
In reply to this post by Allen Wirfs-Brock
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: [hidden email]
Date: Thu, 21 Mar 2013 08:41:35 -0700
CC: [hidden email]
To: [hidden email]

As a keyword.

This is clarified in the ES6 draft (http://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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss