W3C home > Mailing lists > Public > public-html@w3.org > October 2009

Re: typeof document.all

From: Brendan Eich <brendan@mozilla.org>
Date: Tue, 13 Oct 2009 11:58:57 -0700
Cc: "Maciej Stachowiak" <mjs@apple.com>, "HTML WG" <public-html@w3.org>
Message-Id: <5A59EC84-6320-42D5-989D-EB9A562E48DC@mozilla.org>
To: Anne van Kesteren <annevk@opera.com>
On Oct 13, 2009, at 11:47 AM, Anne van Kesteren wrote:

> On Tue, 13 Oct 2009 20:39:42 +0200, Brendan Eich  
> <brendan@mozilla.org> wrote:
>> On Oct 13, 2009, at 11:19 AM, Anne van Kesteren wrote:
>>> typeof gives undefined and ToBoolean gives false. I'm not sure  
>>> there's anything else.
>> What about (document.all == undefined) and (document.all == null)?  
>> How about ===? These do not apply ToBoolean.
> All false. I haven't seen any logged issues on this either, but  
> admittedly I have not looked into it that much. I'm mostly trying to  
> wrap my head around some other specs.

Okey dokey. :-/

I pinged Chris Pine of Opera, who may still be on leave but may know  

>> How is that not what you called a "weird result"? It's similar to  
>> what we do in assigning undefined, i.e., treating assignment as  
>> "detecting".
> Having the object evaluate to false does not seem so weird to me.

Let me get this straight: the only cases where Opera evaluates  
document.all to false are cases in ECMA-262 that apply the ToBoolean  
internal helper. Otherwise it evaluates to a collection.

And typeof document.all == "undefined".

That is simpler than what WebKit does, although as you noted it too  
conflicts with ECMA-262.

But according to bugs I've cited, see


it was not, and by default we presume is not, web-compatible.

Indeed Google codesearch discloses:


So I don't think what you describe, if that's all Opera does, is  
sufficient, because false != null and false != undefined.

Received on Tuesday, 13 October 2009 19:00:04 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:00 UTC