Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9025 closed bug (wontfix)

jQuery.map( array_like ) and bounding values

Reported by: Robert Katić Owned by:
Priority: low Milestone: 1.next
Component: core Version: 1.5.2
Keywords: neededdocs Cc:
Blocked by: Blocking:

Description

Change History (12)

comment:1 Changed 12 years ago by Robert Katić

Updated test: http://jsfiddle.net/CPj3F/

Previous one is not completely correct.

Last edited 12 years ago by Robert Katić (previous) (diff)

comment:2 Changed 12 years ago by Timmy Willison

Component: unfiledcore
Priority: undecidedlow
Resolution: duplicate
Status: newclosed

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:3 Changed 12 years ago by Timmy Willison

Duplicate of #9023.

comment:4 Changed 12 years ago by Robert Katić

True that all those bugs are related to what array-like is, but I would be careful to say this is ad duplicate. It reports a different symptom.

Version 0, edited 12 years ago by Robert Katić (next)

comment:5 Changed 12 years ago by Robert Katić

Not duplicate. #9023 was fixed for me, but this bug is not:

Patch: https://github.com/jquery/jquery/pull/368

comment:6 Changed 12 years ago by Robert Katić

This would also fix #9750.

comment:7 Changed 12 years ago by addyosmani

Resolution: duplicate
Status: closedreopened

Reopening as it would appear that #9750 is a dupe and this already has a pull request on it.

comment:8 Changed 12 years ago by addyosmani

#9750 is a duplicate of this ticket.

comment:9 Changed 12 years ago by ajpiano

Keywords: needsdocs added
Resolution: wontfix
Status: reopenedclosed

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 12 years ago by Robert Katić

@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 12 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 12 years ago by addyosmani

Keywords: neededdocs added; needsdocs removed

The docs for this item have been updated by Karl and I.

Note: See TracTickets for help on using tickets.