W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2008

Re: [whatwg] WebIDL and HTML5

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 26 Aug 2008 08:29:23 -0400
Message-ID: <48B3F723.1050103@mit.edu>
To: Garrett Smith <dhtmlkitchen@gmail.com>
CC: Web Applications Working Group WG <public-webapps@w3.org>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:27 GMT