Re: [WebIDL] Handling undefined in Overload Resolution Algorithm

Lachlan Hunt:
> 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.

Any additional arguments get ignored, per recent changes.  For cases
like this:

  void f(in float x);
  void f(in float x, in float y, in float z);

  f(1, 2);

where the number of arguments is between valid argument counts, it’s
defined to throw, at the moment.

Cameron McCormack ≝

Received on Tuesday, 9 August 2011 10:38:36 UTC