ES6 doesn't need opt-in
Mark S. Miller
erights at google.com
Wed Jan 4 15:23:24 PST 2012
On Wed, Jan 4, 2012 at 9:35 AM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:
> On Jan 4, 2012, at 8:39 AM, Mark S. Miller wrote:
> BTW, The simplest way to work around these issues, that I've found, would
> be to say that any function that uses any new formal parameter syntax is
> implicitly a strict mode function.
Good arguments -- both you and Andreas. I withdraw the suggestion that
these be normative optional -- it indeed accomplished nothing useful.
Instead, we simply do not forbid them in non-strict mode, which as you
observe has always been the status quo.
I accept that destructuring is problematic for reasons I've overlooked. No
doubt others are too. For each one, the first solutions we should reach for
are 1) leave them out of strict mode, or 2) (as you suggest) make its
presence an implicit opt-in to strict mode (which amusingly does
effectively forbid it from appearing in non-strict code).
For destructuring, I think it is less suggestive notationally that it
represents a boundary at which rules change, so I would rather simply omit
it from non-strict mode. But either way would avoid these specification
complexities, which I agree we should avoid.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss