Hopefully last word on Use Strict Directive syntax

Waldemar Horwat waldemar at google.com
Mon Jun 8 18:21:34 PDT 2009

Allen Wirfs-Brock wrote:
> I can imagine that the restriction of strings containing EscapeSequences 
> or LineContinuations might complicate the lexer/parser factoring of some 
> implementations but my recollection is that we wanted to require the 
> precise lexical sequences defined above rather than any equivalent values.

I don't remember us discussing or prohibiting escape codes in the initial evaluation of the string literal.  What we did agree on is that the *value* of the string literal can only be "use strict".

My preference would be to keep things simple and allow any string literal as a directive.  If its value is "use strict" then it turns on strict mode.

Didn't we also have language in there that disallowed newline-based semicolon insertion?  If we do, I'd prefer the prohibition to apply only to newline-based semicolon insertion and not }-based semicolon insertion, so that the following is still a strict empty function:

function f(){"use strict"}


More information about the es5-discuss mailing list