"use strict"; prepended blindly to scripts in the wild

Brendan Eich brendan at mozilla.com
Wed Sep 8 17:25:33 PDT 2010


On Sep 8, 2010, at 3:25 PM, felix wrote:

> in the Names strawman, "private foo" at the top level has the same problem as "use strict" at the top level.  maybe there should be a general way of delimiting a top-level lexical scope, so that pasting js together is still relatively easy?

Today, module pattern:

(function () {
  // "use strict" or private x; here without fear...
})();

Tomorrow, with http://wiki.ecmascript.org/doku.php?id=strawman:simple_modules, something like

module {
  // "use strict" or private x; here without fear...
}

/be


More information about the es-discuss mailing list