Subj : Re: Equivalent of JS_InitClass for global object? To : "John J. Lee" From : Brendan Eich Date : Tue Aug 26 2003 02:03 pm John J. Lee wrote: >>Plus, you can count on window object identity invariance: >>otherWindow.myWindow = window; ; >>assert(otherWindow.myWindow == window). >> >> > >I don't understand what that has to do with my windows not being >global objects. > Forgot to mention that assert(this == window) at top-level must hold, too. Per the previous paragraph, you're stuck with windows as global objects. But say you could separate the two: would you preserve the non-global window object named by the global "window" property across document loads? If so, you would have to clear all non-builtin/default properties, or face security holes and name pollution problems. The solution to both problems (persistent object identity, security/collision-free scope maintenance) is to have the window be the global object. It's been that way since mid-1995. /be .