W3C home > Mailing lists > Public > public-webapi@w3.org > May 2008

Re: [WebIDL] overloading string/null/object

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 23 May 2008 15:42:10 +1000
To: "Web API WG (public)" <public-webapi@w3.org>
Message-ID: <20080523054210.GB18592@arc.mcc.id.au>

Anne van Kesteren:
> If I have
>
>   x(in DOMString y);
>   x(in Document y);
>
> do I need to put [Null=Null, Undefined=Null] in front of "in DOMString" 
> or will this work correctly automatically?

I still need to fix up the text for [[Put]] on host objects to make that
exactly clear, but I imagine that you would put:

  x([Undefined=Null] in DOMString y);
  x(in Document y);

That way, passing null would result in the second ‘x’ being called, and
passing undefined would call the first ‘x’.

(I must check what happens when undefined is passed to functions
expecting an object, at some point.  And fix up the overloading
ambiguity stuff.)

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Friday, 23 May 2008 05:43:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 23 May 2008 05:43:01 GMT