Re: typeof document.all

On Oct 13, 2009, at 12:20 PM, Anne van Kesteren wrote:

> On Tue, 13 Oct 2009 20:58:57 +0200, Brendan Eich  
> <> wrote:
>> 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.
> I quickly skimmed through these and it seems most have something  
> special for Opera, are part of a comment, or are part of the Gecko  
> codebase, or something to that effect. 

There are others like that. I don't know if it works on Opera due to  
some predicate condition in the control flow, though.

> Anyway, yeah, maybe we should be more like WebKit. Good reason to  
> get this all defined :-)

I agree we need some specification, the question is how much. You have  
an object that converts to false in boolean contexts, and of course it  
masquerades as undefined to typeof. But undefined converts to false  
and compares == (not ===) null. You might just need to change a false  
to undefined, and you win.


Received on Tuesday, 13 October 2009 20:51:04 UTC