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 15:20:04 -0700
Cc: Anne van Kesteren <annevk@opera.com>, Maciej Stachowiak <mjs@apple.com>, HTML WG <public-html@w3.org>
Message-Id: <AD08F56F-DC76-4869-9D4B-577C228C2852@mozilla.org>
To: hallvord@opera.com
On Oct 13, 2009, at 3:08 PM, hallvord@opera.com wrote:

>>> I didn't quite understand the comment about "treating assignment  
>>> as  'detecting'" because we do no such thing.
>> The jaron is odd, but you do. A "detecting" use of document.all  
>> would be
>> if (document.all) { IE-only content here }
>> We found (see the links in
>> https://bugzilla.mozilla.org/show_bug.cgi?id=259935#c0 ) that content
>> also did
>> d=document;
>> this.ie=(d.all);
>> and so assignment is "detecting" too, and does *not* detect the
>> document.all collection.
> Isn't the situation here that the variable d just references the  
> real document object, so that d.all in turn references the real all  
> collection, which this.ie again is going to be a reference too. So  
> when this.ie later is used in a boolean context, it refers to the  
> same, old doc.all object with its magic "pretend to be false in  
> boolean contexts" behaviour.

Could be (I haven't tested Opera; that is your department :-) but Anne  
suggested otherwise: "Sure, it evaluates to false." in


Or did I misunderstand his "it" in that sentence?

Received on Tuesday, 13 October 2009 22:21:04 UTC

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