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

Re: [WebIDL] Handling undefined in Overload Resolution Algorithm

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 9 Aug 2011 22:37:59 +1200
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Cc: Jonas Sicking <jonas@sicking.cc>, public-script-coord@w3.org, bzbarsky@mit.edu, allen@wirfs-brock.com
Message-ID: <20110809103758.GA7209@wok.mcc.id.au>
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 ≝ http://mcc.id.au/
Received on Tuesday, 9 August 2011 10:38:36 UTC

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