[Bug 5850] JS global object

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5850





--- Comment #14 from Adam Barth <w3c@adambarth.com>  2008-07-18 07:45:21 ---
(In reply to comment #12)
> so basically the Window object reflects the properties of the global object of
> the active document and you can never get a pointer to the actual global
> object?

Yes.  It does more than just reflect the properties.  It answers every
question, and performs every action, as if it were the global object.  For me,
this is easier to understand in code:

http://trac.webkit.org/browser/trunk/WebCore/bindings/js/JSDOMWindowShell.cpp

Notice that the object just forwards everything to m_window (which is the real
global object).

> does that even make sense?

I'd try something like this:

Upon navigation, create a new global object for the new active document.  All
script references to the old global object now refer to the new global object. 
(Than add some proviso that the references in the scope chain are not "script"
references, or some-such hair splitting.)

The implementation doesn't work by re-writing the references.  Instead it works
by introducing a level of indirection between the references and the object to
which they refer.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 18 July 2008 07:45:57 UTC