ES6 doesn't need opt-in

Mark S. Miller erights at google.com
Wed Jan 4 23:38:23 PST 2012


In your suggestion, when an occurrence of destructuring (or any other new
syntax) is seen, what unit of code is then opting in to strict? Would it be
the nearest enclosing function, module, class, generator, or Program? I
think I'm warming to the idea.

I think having the opt-in unit be the destructuring pattern and everything
recursively contained within it would be a bad idea. In this regard,
destructuring is a different category of opt-in by new syntax than is
module, class, and generator.


On Wed, Jan 4, 2012 at 4:53 PM, Brendan Eich <brendan at mozilla.com> wrote:

> On Jan 4, 2012, at 4:12 PM, "Mark S. Miller" <erights at google.com> wrote:
>
> > The problem I see is that the occurrence of some of these new features,
> like a light use of destructuring, may not be notationally obvious to
> readers.
>
> Maybe not, but for such users, strict mode may not be obviously a problem
> either. This may well be the shortest path to migration and adoption, esp.
> compared to version= lock-in.
>
> /be
>
>
> >
> > --
> >     Cheers,
> >     --MarkM
>



-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120104/4a4370f3/attachment.html>


More information about the es-discuss mailing list