Subj : Re: Rhino - looking for ways to reset a scope.txt To : ariel_ml@netvision.net.il From : Igor Bukanov Date : Thu Aug 28 2003 11:44 am Brendan Eich wrote: > Ariel Malka wrote: > >> Note: by reseting the scope, I mean essentially clearing all the >> user-defined variables, functions, etc. that have been created during >> a previous execution. >> >> Any clues? Thanks! > > > Doesn't Rhino support sealing objects, so that they can't be modified > (property id added or removed; or existing property value changed)? If > so, make a "superglobal", initStandardObjects it, seal it, and use it as > the prototype of each execution's global object. It does support sealed objects, in fact there is a version of initStandardObjects that takes a boolean flag to seal the standard library objects. The problem is that only CVS version of Rhino makes sealed to mean (property id can not be added or removed; or existing property value can not be changed), previously including the last release it mean only (property can not be added or removed) which was not very useful. Regards, Igor .