Re: [WebIDL] Handling undefined in Overload Resolution Algorithm

On 22/08/11 2:41 PM, Cameron McCormack wrote:
> I started doing this today. I got through half of the list of HTML5 APIs
> where you have overloading or optional arguments, and I did not find any
> instance of an implementation treating undefined as an omitted optional
> argument. However, many of them either have non-interoperable behaviour
> across implementations, or have behaviour such that omitting the
> argument has the same result as coercing undefined to the argument type
> and treating it as a specified argument. So I think going ahead with
> this change, and annotating those that really require undefined not to
> be treated as an omitted optional argument, is feasible.

I have now made the change that makes trailing undefined values in 
function calls be treated as missing optional arguments.  I haven't 
added an extended attribute yet to force undefined to be treated as an 
explicit argument in cases where it would otherwise be treated as a 
missing optional argument.  We can add this if we find the need.

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.html.diff?r1=1.390;r2=1.391;f=h

Lachy, can you indicate whether this change is satisfactory.

Thanks,

Cameron

Received on Friday, 9 September 2011 03:12:06 UTC