Ticket #9025 (closed bug: wontfix)
jQuery.map( array_like ) and bounding values
| Reported by: | rkatic | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | core | Version: | 1.5.2 |
| Keywords: | neededdocs | Cc: | |
| Blocking: | Blocked by: |
Description
Change History
comment:2 Changed 2 years ago by timmywil
- Priority changed from undecided to low
- Resolution set to duplicate
- Status changed from new to closed
- Component changed from unfiled to core
Further discussion of this issue should be in the forums. The meaning of array-like is under scrutiny and this will probably result in a change in the docs. However, it is true that { length: 0 } is not supported, so the resolution of this bug's duplicate is accurate.
comment:4 Changed 2 years ago by rkatic
True that all those bugs are related to what array-like is, but I would be careful to say this is an duplicate. It reports an different symptom.
comment:7 Changed 2 years ago by addyosmani
- Status changed from closed to reopened
- Resolution duplicate deleted
Reopening as it would appear that #9750 is a dupe and this already has a pull request on it.
comment:9 Changed 2 years ago by ajpiano
- Keywords needsdocs added
- Status changed from reopened to closed
- Resolution set to wontfix
The consensus we've reached at this stime is that we will not be attempting to detect host objects in $.isPlainObject and $.map. While edge cases like this do come up, detection is unreliable and comes at a relatively high cognitive cost without clear benefit to the vast majority of jQuery users. If in the future, it becomes apparent that this issue is something that is a pain point to a larger contingent of developers, we can revisit the issue. We'll be documenting that array-like objects need to be converted into real arrays before being passed to $.map.
comment:10 Changed 2 years ago by rkatic
@ajpiano: With your comment I have a serous suspicion that you really tried to understand what this bug/patch is about (certainly it is not about host objects). I don't blame you, it is probably my fault too (will try to be more obvious in future).
comment:11 Changed 2 years ago by ajpiano
@rkatic: I hava serious suspicion you really meant to say that I "didn't" really try to understand what this bug/patch is about :) I read my own comment over though a bit and admit that it seems like a response to a different/multiple tickets - which is what I was attempting to do - to explain that at the recent triage sprint we've decided that the resolution to a number of these issues with handling edge cases in core methods will have documentation-, not code-, based solutions.
comment:12 Changed 2 years ago by addyosmani
- Keywords neededdocs added; needsdocs removed
The docs for this item have been updated by Karl and I.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Updated test: http://jsfiddle.net/CPj3F/
Previous one is not completely correct.