Re: [selectors-api] Return value of lookupNamespaceURI

Sam Weinig wrote:
> I believe undefined and null (as well as the empty string) should turn 
> into null.
> 
> "While resolving either a prefix or the default namespace, if the 
> lookupNamespaceURI() method returns undefined or an empty string, the 
> implementation must act as if null had been returned."

Yes, that's what the prose says, but the IDL declares the return value 
to be a DOMString, and by the time you're done converting |undefined| to 
a String per ECMA rules you have "undefined".  That's what Gecko sees on 
the C++ end.

In other words, the prose and the IDL are inconsistent as they stand. 
If the IDL declared a return value which was of a type that could 
actually express |undefined| without a lossy type conversion, the prose 
requirement would make a lot more sense (but of course then you open 
other kettles of worms).

-Boris

Received on Saturday, 12 July 2008 03:13:42 UTC