Subj : Re: [Rhino] Reversing DONTENUM To : netscape.public.mozilla.jseng From : igor@icesoft.no (Igor Bukanov) Date : Thu Jan 09 2003 03:25 am The EcmaScript standard defines that all function and many non-function properties of standard objects like Math. String etc. should be DONTENUM. If you want to change the DONTENUM status of a particular property, you can use ScriptableObject.get/setAttributes methods to clear the Scriptable.DONTENUM flag. If you want to make all properties of your object to be visible in for (..in..) loop ignoring DONTENUM, you can override in your ScriptableObject subclass getIds method like in: public Object[] getIds() { return getAllIds(); } Regards, Igor "Todd Trimmer" wrote in message news:... > How can I reverse the DONTENUM on all the properties and methods of my host > object? I don't understand why DONTENUM is the default. Look at client-side > JavaScript and all the HTMLDom host objects. All their properties and > methods can enumerate. > > More importantly, at what point can I even TRY to reverse the DONTENUM? The > constructor? jsConstructor? static initializer? When in my Host object's > life cycle I am guaranteed all the jsFunction_*, jsGet_*, and jsSet_* > properties have been set? Do I have to "lazily" do this in my override of > Scriptable#getIds()? > > Can we add ScriptableObject#defineClass(Scriptable, Class, boolean, boolean) > with the last parameter telling whether DONTENUM should applied at all? > > If I add a normal Java object to a scope, all of its public methods, fields, > and properties are enumerated. So how come Host objects' properties and > methods are not enumerated? > > > Todd Trimmer .