Directive prologue members, escapes, and retroactive syntax errors

Oliver Hunt oliver at apple.com
Wed Oct 13 14:44:30 PDT 2010


On Oct 13, 2010, at 12:09 PM, Jeff Walden wrote:

> The MS ES5 test suite has a test which boils down to this:
> 
> function error()
> {
>  "\145"; // ohai, octal escape
>  "use strict"; // causes a RETROACTIVE SYNTAX ERROR
> }
> 
> ...
Jeff just mentioned another brilliant case on irc:

"us\145 strict";

should parse fine, as the "use strict" directive can't contain any escapes, so this won't trigger strict mode.

/me boggles

> Thoughts from other parser hackers out there?
> 
> Jeff
> _______________________________________________
> es5-discuss mailing list
> es5-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es5-discuss



More information about the es5-discuss mailing list