Re: [whatwg] WebIDL and HTML5

Garrett Smith wrote:
>>>> That can be the default, perhaps.  But I suspect usually null should
>>>> become
>>>> "", not "null".
>>> Why?
>> Honestly?  Because that's what Firefox does right now, except in certain
> 
> That is not true. Firefox has Spidermonkey.

The Spidermonkey part is irrelevant for purposes of this discussion, 
except in places where JS_ValueToString is used (basically DOM0 
special-cases).  What matters is the XPConnect glue layer which converts 
JS function calls into C++ function calls in the general case.

In fact, the relevant code for Gecko 1.9 is right here:

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/js/src/xpconnect/src/xpcconvert.cpp&rev=1.129&mark=743-751#731

and

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/js/src/xpconnect/src/xpcprivate.h&rev=1.283&mark=932-934#922

It converts a JSVAL_NULL into an empty nsAString with the IS_VOID bit set.

> Firefox' 3.1 (Minefield) implementation window.open() produces a
> different result as window.open(undefined).

Indeed, because the latter goes through XPconnect, which converts 
undefined to "undefined" for some odd reason.

-Boris

Received on Tuesday, 26 August 2008 12:30:10 UTC