Hopefully last word on Use Strict Directive syntax

Waldemar Horwat waldemar at google.com
Tue Jun 9 13:12:14 PDT 2009


Allen Wirfs-Brock wrote:
> I thought that there was a desire for "use strict" to occur exactly that way and not as:
> "\u0075se strict" or
> "use\
>  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.

You disallowed it previously, so I was simply expressing surprise at the change in your last email.  There was no discussion of this at the last meeting.

Not sure what the technical ramifications are one way or another.  They're probably limited to confusion if an implementation provides a use-directive that turns off semicolon insertion and other use-directives are used without a semicolon.  If you get into the habit of omitting semicolons, you can also run into trouble with things that look like they're strict but are not:

function f(x) {
  "use strict"
  +x ? delete p : delete q;
}

Overall, likely to cause a bit of trouble but not a show-stopper.

    Waldemar


More information about the es5-discuss mailing list