Re: typeof document.all

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

/be

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