excluding features from sloppy mode

David Herman dherman at mozilla.com
Fri Dec 28 12:08:31 PST 2012


On Dec 28, 2012, at 3:01 AM, Kevin Smith <khs4473 at gmail.com> wrote:

> I'm tellin' ya, no one's going to write any significant non-module code.  : )

+9001 (to quote rwaldron)

We should hold the line against any implicit opt-in beyond modules. Mark argues that classes are coarse-grained, but they can easily be significantly finer-grained than modules. In particular, they're an expression form and can be used for tiny little one-offs:

    var f = new (class() { m(x) { } })();

Modules are the largest-grain code structuring form, and they are the *biggest biggest biggest* carrot we have to offer for strict mode.

I'm fine with adding a "use strict"; pragma to classes, but it's also just as easy to place them in a strict context, either by putting them in a module or a strict function.

Dave



More information about the es-discuss mailing list