Ticket #9027 (closed bug: invalid)
jQuery.map( jQuery() ) does not enumerates all method names.
| Reported by: | rkatic | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | core | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Test: http://jsfiddle.net/7jSF8/
Documentation: "Array-like objects, such as jQuery collections, are treated as arrays. In other words, if an object has a .length property and a value on the .length - 1 index, it is traversed as an array."
jQuery() has length == 0, and no value at index -1, so by definition it will not be considered array-like!
But strangely if the empty jquery is from an iframe, $.map correctly enumerates all properties: #8995.
Silly? Nooooo
Related tickets: #9023
Change History
comment:2 Changed 2 years ago by timmywil
- Priority changed from undecided to low
- Resolution set to invalid
- Status changed from new to closed
- Component changed from unfiled to core
That is the correct behavior. map iterates through elements, not the prototype. There may be some debate on the related tickets, but this one needs to stay the way it is.
comment:4 Changed 2 years ago by timmywil
Understood, #8995 presents a possible bug. Please do not open tickets to make points.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Irony at side. Will not fill any further related ticket, I promise, but please reconsider this new crazy feature, even if it was voted by 1E3 persons.