Uninteresting parameters

Dean Landolt dean at deanlandolt.com
Tue Sep 27 13:21:15 PDT 2011

On Tue, Sep 27, 2011 at 4:04 PM, Brendan Eich <brendan at mozilla.com> wrote:

> On Sep 27, 2011, at 12:50 PM, Sean Eagan wrote:
> > I agree, but it seems like holes in parameter lists would be no more
> > rare than holes in destructuring lists...
> >
> > [a, , c] = arr;
> Could be.
> > ...so it seems strange to add it to one but not the other.
> Destructuring uses the same grammar as "structuring", i.e. ObjectLiteral
> and ArrayLiteral. We can and are making post-parse ("Supplemental Syntax")
> restrictions, so we could forbid holes, but it's more work.
> Contrast to parameter lists where adding holes is more work.
> Is more work for the spec the good to optimize? For such truly marginal
> cases, I think so.

Out of curiosity is there any reason to keep holes the holes around in
ObjectLiteral and ArrayLiteral? Is there a real usecase (other than rare and
trivial minification wins)? Sure, it would be a breaking syntax change but
statically detectable and correctable. And it would wipe out a source of
bugs rather than doubling down.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110927/b13f15af/attachment.html>

More information about the es-discuss mailing list