W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2011

Re: [WebIDL] Handling undefined in Overload Resolution Algorithm

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 09 Aug 2011 12:29:31 +0200
Message-ID: <4E410C0B.60106@lachy.id.au>
To: Jonas Sicking <jonas@sicking.cc>
CC: Cameron McCormack <cam@mcc.id.au>, public-script-coord@w3.org, bzbarsky@mit.edu, allen@wirfs-brock.com
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
Received on Tuesday, 9 August 2011 10:29:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:04 UTC