excluding features from sloppy mode

Axel Rauschmayer axel at rauschma.de
Wed Dec 26 20:25:30 PST 2012


> So, case by case:
> 
> * arrow function syntax (which does not imply "use strict" in body prologue)
> * class
> * const
> * default parameters
> * destructuring
> * rest parameters
> * generators (function*, yield in function* body)
> * comprehensions
> * generator expressions
> * module
> 
> all seem to work in 1JS via the "new syntax is its own opt-in" rule, including any stricter/saner semantic checking.
> 
> I left out 'let' and function-in-block. Let's set those aside for a moment.
> 
> Anyone disagree that the bulleted syntactic extensions listed above should be their own opt-in, and think instead that some or others or all should appear only to strict code? (Mark, here's your chance! ;-)

Am I getting the following grouping right? I’d argue that all members of the second category usually have small bodies; having ES6 syntax only there might make things too fragmented.

(1) opt-in for bodies:
* class
* default parameters
* rest parameters
* destructuring (parameters?)
* generators (function*, yield in function* body)
* module

(2) opt-in for surrounding scope:
* arrow function syntax (which does not imply "use strict" in body prologue)
* const
* comprehensions
* generator expressions

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121227/ea0fa8b8/attachment-0001.html>


More information about the es-discuss mailing list