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

On 6/18/13 2:15 AM, Cameron McCormack wrote:
> So what about this part of the proposal?  Presumably there are reasons
> that ES6 currently forbids an argument with a default value that is
> followed by one without a default value.

The reason I was given is that given

   function f(a = 5, b) {
   }
   f(6);

it's not clear whether that maps to (a=6,b=undefined) or to (a=5,b=6).

That said it's pretty clear to me that it maps to the former.  On the 
other hand, it sure would be handy to be able to do f(undefined, 6) and 
have it come out with (a=5,b=6).

-Boris

Received on Tuesday, 18 June 2013 12:24:35 UTC