What's the correct behavior for "\8" and "\9"

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Mar 24 17:22:13 PDT 2013


On Mar 24, 2013, at 6:32 AM, BelleveInvis wrote:

> However, even in the newest draft, "\8" still should cause a syntax error. Should we change the production "EscapeCharacter ->DecimalDigit" into "EscapeCharacter -> OctalDigit" in order to make 8 and 9 belongs to NonEscapeCharacter?

Probably, but need to look carefully at any possible spec. interactions with OctalEscapeSequences defined in Annex B.  (Note that in ES5 we make octal escapes illegal in strict mode code, but they are still allowed in non-strict code)

Allen




> 
> > Date: Sat, 23 Mar 2013 13:58:41 -0700
> > From: brendan at mozilla.com
> > To: infinte.cdda at hotmail.com
> > CC: es-discuss at mozilla.org
> > Subject: Re: What's the correct behavior for "\8" and "\9"
> > 
> > BelleveInvis wrote:
> > > According to spec: Syntax error, because of that 8 or 9 does not
> > > belongs to /NonEscapeCharacter/.
> > > However, ALL browsers treat them as "8" and "9".
> > 
> > Web compatibility seems to require "noctal" escapes in string literals.
> > No one has really investigated how much web content, but it was true in
> > the past and engines don't like taking risk for little gain.
> > 
> > /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130324/98348920/attachment.html>


More information about the es-discuss mailing list