Subj : Re: Big problem, please help... To : Cunac From : Brendan Eich Date : Mon Nov 17 2003 10:27 am Cunac wrote: >>Not quite: with JSOPTION_VAROBJFIX, both explicitly declared global >>variables (var x) and implicit ones (x = 42 where no x exists yet in the >>scope chain) both go in the last object on the parent-linked scope >>chain. Without that option, explicit globals go in the first object on >>the scope chain, while implicit globals go on the last. >> >>What you want (both explicitly and implicitly declared globals go in the >>first object on the scope chain) is nowhere specified in ECMA-262. >> >>Why do you think you want such a thing? >> >> > >I have need of that feature to simplify scope handling (one scope-one >object, sharing some global scope variables, but restricting one scope to >create variables only in its own space). This is simple feature to >implement, so I guessed that there is a override. No matter, I will do it on >a hard way.... Thnx for your time! > > > I don't know how you will do it -- please don't hack the engine, thereby creating a non-standard and incompatible dialect of the language. If the global object (the last object on the parent-linked scope chain) is not where variables go, then what does go there? If you wish to share standard classes (Date, RegExp, etc.), consider linking to a "superglobal" via the proto, not the parent, slot. /be .