Cameron McCormack wrote:
I think of it more like that null is the actual namespace URI value, and
that an empty string is the non-standard way of specifying it (rather
than the other way around).  Which makes me think of this more as
something the method should handle, rather than something the bindings
worry about.

But the method signature in IDL is DOMString. So by the time it sees the argument, it will be a DOMString. The only question is which DOMString.

In Gecko, if you pass in "" it will see the string "".

If you pass in null, it will see a string that is equal to "" but has a "this is a null string" bit set.

Conceptually, the latter is more like a |char * str = NULL| and the former is more like a |char * str = "";| but both represented by a String object of some sort.

It might make sense to declare this the default conversion of null to DOMString and then have NoNull mean that the Object.prototype.toString conversion should be used instead.

-Boris


-Boris

Reply via email to