Re: typeof document.all

On Tue, 13 Oct 2009, Brendan Eich wrote:
> 
> Thinking this through, I have two general approaches for alternative 3 
> in mind, hope it's ok to throw them out quickly:
> 
> (3a) underspecify document.all as a host object property that may be 
> reliably tested only by if, &&, ||, == null, == undefined, and ! and the 
> != counterparts. Anything else is unspecified behavior.

Personally I would be against underspecifying anything that can be 
black-box tested from a Web page.


> (3b) specify document.all as an ES-Harmony value type, details TBD but 
> this allows overloading operators including ! and == but not === (at 
> least not in the discussions we've had yet), and overloading ToBoolean.

Sounds good to me. Is this basically equivalent to what HTML5 says today?

   http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-all

(Except without violating ES! :-) )

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 14 October 2009 00:19:05 UTC