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

BelleveInvis infinte.cdda at hotmail.com
Sun Mar 24 21:05:49 PDT 2013


However, \8 and \9 DOES NOT belong to OctalEscapeSequences. There is NO octal number contains 8 or 9.

Subject: Re: What's the correct behavior for "\8" and "\9"
From: allen at wirfs-brock.com
Date: Sun, 24 Mar 2013 17:22:13 -0700
CC: brendan at mozilla.com; es-discuss at mozilla.org
To: infinte.cdda at hotmail.com


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/20130325/4155832c/attachment.html>


More information about the es-discuss mailing list