excluding features from sloppy mode

Kevin Smith khs4473 at gmail.com
Sat Dec 29 20:40:39 PST 2012

The more I think about this, the more convinced I get that all new syntax
and breaking changes (where possible) should be strict-mode only.  In
retrospect, `let[x] = y;` changed everything.  Here's why I think "1JS
under strict" is the best solution:

- How exactly would one teach that classes, arrows, etc. are all available
in sloppy mode, but "let" is not?  The reason is obscure for a casual user.
 It's going to seem arbitrary.  On the other hand, "1JS under strict" is
quite easy to teach.

- It creates a clean, linear evolution for javascript syntax:  ES3 > ES5
strict > ES6 > ES7.

- It eliminates the so-called "micro-modes" in function heads.

- It gets everyone moving in the same direction:  strict mode.

- It eliminates subjective questions about what constructs should be
implicitly strict.

To be clear, I'm proposing that:

1) All new syntax and breaking changes (where possible) are strict-mode
2) Modules and only modules are implicitly strict.

Why not?

Lurkers out there!  Would anyone be opposed to opting-in to new ES6 syntax
by either (a) "use strict" or (b) modules?

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121229/35c9a83b/attachment.html>

More information about the es-discuss mailing list