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

Allen Wirfs-Brock wrote:
> Cameron, Either I'm misinterpreting what you are trying to say or you
> misunderstand what Boris said.  ES6 does allow a parameter with an
> explicit default value to be followed by one without an explicit
> default value.  The NOTE in 13.1 for ExpectedArgumentCount says:
> "...A FormalParameter without an initialiser is allowed after the
> first parameter with an initialiser but such parameters are
> considered to be optional with undefined as their default value."
> That semantics is normatively specified in the algorithms that
> validate a formal parameter list.
>
> This is all about determining the "length" value of a function.
> Length is the number of required arguments which is defined to be the
> number of formal parameters to the left of  the first parameter with
> a default value initializer (or the rest parameter).

Thanks Allen, I also hadn't realised that the ES6 spec had allowed 
argument initialisers everywhere.


I've made the corresponding Web IDL changes now to allow optional 
arguments and default values everywhere, too.

Boris, when you're able to, review of these changes would be appreciated.

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.628;r2=1.629;f=h
http://dev.w3.org/cvsweb/2006/webapi/WebIDL/v1.xml.diff?r1=1.78;r2=1.79;f=h

Received on Monday, 24 June 2013 07:54:44 UTC