Re: should window.foo return a HTMLCollection if div id=foo and form name=foo exist?

Martin Honnen <[email protected]> Thu, 15 Nov 2012 15:48:27 +0100
Newsgroups gmane.comp.mozilla.devel.dom
Organization Liberty Development
Message-ID <[email protected]>
Boris Zbarsky wrote:
> On 11/15/12 6:29 AM, Martin Honnen wrote:
>> So two questions, why is "window.foo" first undefined and suddenly
>> defined after an access to "foo"?
>
> Because we used to only do global scope pollution on unqualified
> lookups.  I suggest retesting in a nightly build.

Is Aurora 18.0a2 (2012-11-14) not a nightly? With that I see the output


window.foo

window.foo: undefined
foo

foo: [object HTMLDivElement]
window.foo

window.foo: [object HTMLDivElement]