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

Re: [WebIDL] Handling undefined in Overload Resolution Algorithm

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 19 Jul 2011 13:32:37 -0400
Message-ID: <4E25BFB5.60703@mit.edu>
To: public-script-coord@w3.org
On 7/19/11 1:06 PM, Jonas Sicking wrote:
> On Tue, Jul 19, 2011 at 6:04 AM, Lachlan Hunt<lachlan.hunt@lachy.id.au>  wrote:
>> Hi,
>>   Refer to discussion in a Mozilla bug 648722 [1].
>>
>> When undefined in passed to an overloaded function, the overload resolution
>> algorithm should not exclude nullable non-primitive types.
>
> I'm not quite sure I understand what you are suggestion. Are you
> saying that we should treat undefined as null when calling a function
> that takes a nullable type?

That's the proposal, yes.  This is already true if the nullable type is 
something like |String?|, but not if the nullable type is |Node|.  The 
proposal is to make is to passing |undefined| where an interface type is 
expected behaves the same as passing null (as opposed to throwing 
immediately because no overload is found).

-Boris
Received on Tuesday, 19 July 2011 17:33:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC