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:39:42 -0700
Cc: "Maciej Stachowiak" <mjs@apple.com>, "HTML WG" <public-html@w3.org>
Message-Id: <CA3FC9D9-CCC4-4210-951C-E89C0026E49D@mozilla.org>
To: "Anne van Kesteren" <annevk@opera.com>
On Oct 13, 2009, at 11:19 AM, Anne van Kesteren wrote:

> On Tue, 13 Oct 2009 20:07:02 +0200, Brendan Eich  
> <brendan@mozilla.org> wrote:
>> Anyway, an informal spec-let detailing what Opera does to at least  
>> the
>> level of detail that Maciej gave would be helpful.
> 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.

>>> Violating the ECMAScript specification was apparently much more
>>> straightforward, and would not give weird results when assigning
>>> document.all to a variable.
>> We found that necessary for IE-only page compatibility:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=259935
>> Does Opera work  correctly (more precisely, did it work correctly
>> ~2004-2005) on the pages cited in comment 0 of that bug? If so, why?
>> It must not have been running the code we were, or else assigning
>> document.all to a variable must not have created the collection.
> Sure, it evaluates to false.

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".

Received on Tuesday, 13 October 2009 18:41:56 UTC

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