[Webkit-unassigned] [Bug 14901] for in loop on an Array does not work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 18 01:54:23 PDT 2008


ap at webkit.org changed:

           What    |Removed                     |Added
                 CC|                            |ap at webkit.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

------- Comment #8 from ap at webkit.org  2008-09-18 01:54 PDT -------
(In reply to comment #6)
> True, nevertheless for-in works fine on MSIE7 and FF2. Isn't the NodeList
> enumerated? Why would for work and for-in not?

I think that this was a bug in WebKit shipping with Safari 2, fixed in Safari
3. However, it's still a bad idea to use for-in with NodeLists. For-in
enumerates all properties of NodeList, so you get not only loop 0...loop 4, but
also loop length and loop item. This is rarely what is needed.

(In reply to comment #7)
> 0
> 1
> 2
> 3
> 4

I'm getting identical results in Firefox.

Since this bug doesn't contain any issues identified as bugs, I'm closing it as
INVALID. Please feel free to open new bugs if you disagree - this one contains
a lot of confusion between arrays and NodeLists, so it would be better to avoid
continuing the discussion here.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list