W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: Reconciling handling of optional arguments and handling of default values across ES and webidl

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 10 May 2013 01:27:00 -0400
Message-ID: <518C8524.9040904@mit.edu>
To: public-script-coord@w3.org
On 5/8/13 4:20 PM, Brandon Benvie wrote:
> On 5/8/2013 11:18 AM, Boris Zbarsky wrote:
>> 2)  Have arguments.length not include trailing undefined values.
>
> Do you mean only when there's defaults defined?

No, I meant in all cases.

> As in this returns `0`:
>
>      (function(a = 1, b = 2, c = 3){
>        return arguments.length;
>      })(undefined, undefined, undefined);

Hmm.  What would be the benefit of that?

> For compatibility with a lot of existing JS code, the following must
> return `3`:
>
>      (function(a, b, c){
>        return arguments.length;
>      })(undefined, undefined, undefined);

Yeah, that's the impression I get.  Sad, but ok.

-Boris
Received on Friday, 10 May 2013 05:27:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC