There are two different kinds of problems with for..in loops. A minor one is the "objects are not arrays" issue outlined in referenced page, (http://proto-scripty.wikidot.com/faq#forin). As far as I know every array iteration in firebug uses numerical indexing.
A more subtle problem has to do with objects in a prototype chain. Whenever Firebug has a object as a lookup table, it tests "obj.hasOwnProperty(name)" to do the look up. This helps insure that the value you put in the table under 'name' is the one that comes back out. See for example, http://javascript.crockford.com/code.html. However none of this changes the basic problem facing Curtis: no change to Firebug will really allow prototype to be used in Firefox. John. On Oct 14, 7:29 am, Lapis <[EMAIL PROTECTED]> wrote: > If one uses for..in loops for what they really are, there is no > problem. > > Among other sources of javascript knowledge on the web, event the > proto-scripty-link you gave explains the nature of a for...in loop. It > simply doesn't do what many people seem to think it does. For these > people, of course the results of for...in loops are "unexpected" when > extension has been done. > > On Oct 9, 8:27 pm, Curtis <[EMAIL PROTECTED]> wrote: > > > [...] > > That last question I ask because there is an issue with Zotero where > > it doesn't play nicely with extensions that extend Javascript's > > Array.prototype. From what I understand if Array.prototype is extended > > (as it is with Prototype) and for..in loops are used, unexpected > > things will happen (http://proto-scripty.wikidot.com/faq#forin). > > [...] > > --C --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/firebug?hl=en -~----------~----~----~----~------~----~------~--~---
