Subj : Re: [spidermonkey] JS_CallFunction in Finalize To : netscape.public.mozilla.jseng From : Brendan Eich Date : Fri Aug 26 2005 03:19 pm Brendan Eich wrote: > Brendan Eich wrote: > >> Consider DOM window objects. If I write , I shouldn't leak, but the opened >> window should be visually closed when the user clicks on its close [x] >> box or whatever widget is used by the desktop/window-manager/OS for >> closing windows, and at *that* point, "onunload" or a hypothetical >> "onclose" event handler should run -- *not* later when the window >> object is finalized by the GC. > > > Now consider > > This example was fake, it pretended that window.open is synchronous. Here's a real example: /tmp/foo.html: /tmp/bar.html: Once you've disabled the Firefox popup blocker appropriatly for file: (or the empty host part, eek!), you should see a new window followed by two alerts, the first showing "[object Window]", the second "hello from bar.html!". /be .