Hopefully last word on Use Strict Directive syntax

Allen Wirfs-Brock Allen.Wirfs-Brock at microsoft.com
Tue Jun 9 12:01:24 PDT 2009

I thought that there was a desire for "use strict" to occur exactly that way and not as:
"\u0075se strict" or
 strict" or other possible variations and I couldn't specify that with a simple string value requirement.

As Unicode escapes are not allowed in ECMAScript keywords that seemed like a reasonable desire. However, I can make it string value based if there is consensus on that.

On the other hand, I don't see any particular reason to disallow semi-colon insertion within the Directive Prologue. Given that we have it (even in strict mode) why would we disallow it here? It just adds specification complication and an additional special case for users to learn.


>-----Original Message-----
>From: Waldemar Horwat [mailto:waldemar at google.com]
>Sent: Monday, June 08, 2009 6:22 PM
>To: Allen Wirfs-Brock
>Cc: es5-discuss at mozilla.org
>Subject: Re: Hopefully last word on Use Strict Directive syntax
>Allen Wirfs-Brock wrote:
>> I can imagine that the restriction of strings containing
>> or LineContinuations might complicate the lexer/parser factoring of
>> implementations but my recollection is that we wanted to require the
>> precise lexical sequences defined above rather than any equivalent
>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"}
>    Waldemar

More information about the es5-discuss mailing list