Re: [WebIDL] Handling undefined in Overload Resolution Algorithm

On 2011-08-08 23:56, Jonas Sicking wrote:
> I guess that would mean that we'd have to say that 'undefined' also
> has special meaning if there are overloads that take fewer arguments
> too. In addition to saying that it has special meaning if there are
> overloads which take optional arguments.

That's an issue that needs to be handled in general too, not just when 
undefined is passed, since, for example, if the function is defined as:

   void f(in DOMString foo);

And then it is called as:

   x.f("foo", "bar")

Then it should just ignore the second parameter.  This is essential 
behaviour that allows, for example, querySelector() to be extended with 
extra parameters, while not causing problems with legacy implementations.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Tuesday, 9 August 2011 10:29:59 UTC