07.08.2014, 20:16, "Mark S. Miller" <[email protected]>:
On Thu, Aug 7, 2014 at 8:52 AM, Alex Kocharin <[email protected]> wrote:So strict mode is mandatory in classes and modules, and can't be turned off. Since it is mandatory, it is no longer "strict mode" like it is in perl. You can't opt out of it if you want to. Therefore all legacy constructs should be allowed there unless they are guaranteed to break the code in the future.Sooner or later people will migrate their legacy code into es6 modules. We would want to make this migration as easy as possible. And saying that "02468" is fine in es3, forbidden in es6, and allowed again in es8 with *exactly the same meaning* isn't helping.I expect "with" and 02468 will continue to be allowed in es6 sloppy, es8 sloppy, and es1000 sloppy. The best way to think of sloppy code is "es3 compatibility mode". I don't see that there's any other sensible purpose for it. Why would you want to say "with" or 02468 for any purpose other than not breaking old legacy es3 code?
I want to be able to use new es6 features in a legacy code with minimal changes. For example, provide a es6 module that exports this legacy code. Keep in mind that this legacy code could be minified, obfuscated and/or immutable because of a license.
As of now, I can wrap any code in an AMD or CommonJS module. But not in ES6 module because of the implicit strict mode. This did cause to choose AMD over Traceur+ES6 in one of my projects in the past by the way, so it's not something abstract. If you look in Traceur, there is 16 issues regarding strict mode, for example this one - https://github.com/google/traceur-compiler/issues/1031 .
Also, "es1000 sloppy" is a very bad idea. We should have one _javascript_ mode. Two modes as of now bring no value, it just makes compilers more complex, and spec more lengthy for no reason. By the time es8 comes out, it should really deprecate either strict mode or sloppy mode, so the next _javascript_ engine will be able to ditch it.
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

