Uninteresting parameters
Brendan Eich
brendan at mozilla.com
Tue Sep 27 13:04:15 PDT 2011
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.
/be
More information about the es-discuss
mailing list