ES6 doesn't need opt-in

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Jan 6 00:05:20 PST 2012


On Jan 5, 2012, at 10:38 PM, Luke Hoban wrote:

> ... 
> # Why ‘implicit explicit opt-in’ doesn’t seem reasonable #
>  
> The prevalent alternatives presented in this thread are variations of “implicit explicit opt-in”, where use of some new syntax causes some part of the code inside or outside of it to start behaving differently (breaking changes).  I think in practice this will be very confusing.  Take this:
>  
>   var x = typeof null;
>   module {
>     var y = typeof null;
>     x == y // false!
>   }
>  

Note that my most resent postings were suggesting a different form of "implicit explicit opt-in":  use of new syntax causes all of the code in the same source file to potentially behave differently

  var x = typeof null;
  module {
    var y = typeof null;
    x == y // ----->true!
  }

In practice, I agree that we don't want to make such a breaking change for typeof.  But this approach would allow to make "strict mode semantics" be implicit for any source file that uses any new ES6 syntactic features.

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120106/3216372c/attachment.html>


More information about the es-discuss mailing list