Hopefully last word on Use Strict Directive syntax

David-Sarah Hopwood david-sarah at jacaranda.org
Mon Jun 8 18:36:15 PDT 2009

Allen Wirfs-Brock wrote:
> Waldemar's notes from the last TC39 F2F say:
> "use strict" resolution:  A use strict directive must be the literal
> string "use strict".  It must occur before any statement other than
> other literal string-semicolon pairs.

This change is highly inconvenient for me. The current draft spec
and implementation of Jacaranda was using the syntax
"use strict,jacaranda". While it is possible to accept
"use strict"; "use jacaranda"; instead, the fact that this spans
more than one SourceElement makes checking for it significantly more
complicated using an S-attributed grammar.

I would prefer the string literals to all be in the first SourceElement,
which may be a comma expression. For example

  "use strict", "use jacaranda";

I.e. the syntax would be

  Directives :
    Directives ',' StringLiteral

David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

More information about the es5-discuss mailing list