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: Brandon Benvie <bbenvie@mozilla.com>
Date: Wed, 08 May 2013 13:20:44 -0700
Message-ID: <518AB39C.208@mozilla.com>
To: public-script-coord@w3.org
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? As in this returns `0`:

     (function(a = 1, b = 2, c = 3){
       return arguments.length;
     })(undefined, undefined, undefined);


For compatibility with a lot of existing JS code, the following must 
return `3`:

     (function(a, b, c){
       return arguments.length;
     })(undefined, undefined, undefined);
Received on Thursday, 9 May 2013 14:34:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:13 UTC