Subj : Re: Enumeration of extended properties of Array and Object prototypes To : netscape.public.mozilla.jseng From : Chris Zumbrunn Date : Sat Mar 20 2004 04:45 am Brendan Eich wrote: > ECMA dictates that it should be "123foo". > > Did you mean that native code defined 'foo' as some kind of built-in? In > that case, the native code can use ECMA DontEnum, or in SpiderMonkey > terms, can not use JSPROP_ENUMERATE. No, I do mean prototype properties that are defined dynamically via Javascript. > If you mean exactly what you show as an example, then there's no way any > conforming implementation can avoid enumerating 'foo'. Yes, I know that :-) Getting back to my original question... Is a change to this being considered for JS 2.0 (and the next ECMA specs). Is any way being considered that would allow to add members to objects, particularly prototype objects, without them being enumerated by for/in loops? This could for example also be in the form... dontenum Array.prototype.foo; ....or something of that nature, if that helps to avoid backwards compatibility headaches. Could the current Rhino engine be patched in any way that would allow objects that act as collections to provide methods that act on those collections? Has someone already attempted or done this? Or is there a good reason why this would be a bad idea (other than breaking the specs)? Chris .