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

On 5/9/13 3:09 PM, Garrett Smith wrote:
> Too much complexity from overloading and too many parameters. A value
> object would be a consideration for API redesign.

This API can't be "redesigned".  We all agree it's a crappy API, but 
it's widely used.  The question is to what extent we can/should change 
its behavior in edge cases without a wholesale redesign.

>>     drawImage(image, 0, 0, undefined);
>>
>> should do.  In today's world it throws.  Should WebIDL preserve the
>> ability to do that in that situation?
>>
> According to the spec, it looks like that isn't valid but I don't see
> what it says about what happens when four arguments are passed.

See 
http://dev.w3.org/2006/webapi/WebIDL/#dfn-overload-resolution-algorithm 
which will end up throwing in step 7.

> Normally, extra
> arguments are ignored so anything over 9 might be predictable

Indeed.

-Boris

Received on Thursday, 9 May 2013 19:25:15 UTC