excluding features from sloppy mode
domenic at domenicdenicola.com
Sat Dec 29 21:33:18 PST 2012
> From: es-discuss-bounces at mozilla.org [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Brendan Eich
> Sent: Sunday, December 30, 2012 00:06
> by yoking ES6 feature adoption to strict mode adoption, you multiply risks and reduce ES6 adoption.
I'd like to lend a little bit of defense to Kevin's ideas here. Namely, it seems easy to me to imagine the following:
- "Oh cool, ES6 is in $MY_FAVORITE_JS_ENVIRONMENT!"
- "Awesome lemme insert some arrow functions to clean up all these map and filter arguments"
- "What's that, Mr. Compiler? You won't let me use arrow functions unless I put 'use strict' at the top of my file?"
- "OK, whatever, that seems lame, but arrow functions are worth it."
This is of course predicated on the code in question not being affected by the breaking changes of strict mode, which is probably true of most code written by early adopters today.
To be clear, there's obviously a lot of subtle issues here, as Brendan has pointed out. I do find it somewhat unlikely though, that *if* strict mode was required for anything ES6-ish, people would give up their new toys rather than point a pragma at the top of their file.
(Although, as I write that last sentence, I realize this isn't much different than suggested `use version 6` :-/)
More information about the es-discuss