Re: typeof document.all

On Tue, Oct 13, 2009 at 5:38 PM, Brendan Eich <brendan@mozilla.org> wrote:
> On Oct 13, 2009, at 5:30 PM, Ian Hickson wrote:
>
>> 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.
>
> This is silly. Is everything else in HTML5 full specified in terms of
> effects in the DOM, global objects, information leaks including implicit
> flows, and anything else "that can be black-box tested"?
>
> I doubt it!
>
> BTW, are you amenable to confining document.all to quirks mode?

I agree with Brendan. In general I'm against leaving things undefined.
However, as with any other general principle, there are exceptions. If
it's extremely unlikely that undefined behavior will be depended on,
and if specifying that behavior carries significant costs, then
leaving things undefined can be the way to go. I believe this is one
of those cases.

/ Jonas

Received on Wednesday, 14 October 2009 00:49:40 UTC