Hi Derrell, Am 18.01.2009 um 20:42 schrieb Derrell Lipman:
> It's also perfectly legal, however, as with any object, to add > additional methods to Array's prototype, and I don't believe that > the spec says whether these new methods should or shouldn't be > enumerated with for/in when using an array. (I would argue that they > shouldn't be, and that it's a bug in IE that they are, but that's a > separate issue.) I'm not sure whether these methods should be enumerated or not. > Given that IE does behave differently than Firefox in this area, I > agree with you that qoxodoo should not add methods to the Array > prototype. I believe that you and I both argued that long ago. At > this point, however, it would be a huge backwards-compatibility hit > to remove them. Agreed. > I would recommend that they be removed in 0.9 with migration scripts > to correct the array method usage to static function usage. Good idea. > For qooxdoo use right now, if one wants to use for/in, the following > usage model might be appropriate: > > var a = new Array(); > var x = new Array(); > a[23] = 42; > for (var i in a) > { > if (! isNaN(parseInt(i))) > { > x.push(i + ": " + a[i]); > } > } > alert(x.join('\n')); Sorry, but this is ugly as hell :-) Better stick to saying "don't use for ... in on arrays with qooxdoo" ;-) Regards, Andreas J. ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel