Side navigation
#10616 closed bug (fixed)
Opened October 29, 2011 01:22PM UTC
Closed November 06, 2011 09:21PM UTC
Last modified November 06, 2011 10:05PM UTC
Type coersion not done for -1 in .eq
Reported by: | anonymous | Owned by: | rwaldron |
---|---|---|---|
Priority: | low | Milestone: | 1.7.1 |
Component: | core | Version: | 1.7b2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Test case: http://jsfiddle.net/pimvdb/NZdAa/1/
Proposed fix:
eq: function( i ) { return +i === -1 ? this.slice( i ) : this.slice( i, +i + 1 ); },
instead of
eq: function( i ) { return i === -1 ? this.slice( i ) : this.slice( i, +i + 1 ); },
(Notice the extra +.)
Attachments (0)
Change History (7)
Changed October 29, 2011 01:24PM UTC by comment:1
Changed October 29, 2011 02:16PM UTC by comment:2
_comment0: | Another perspective on the test case: http://jsfiddle.net/rwaldron/NZdAa/4/ → 1319897810324125 |
---|---|
component: | unfiled → core |
owner: | → rwaldron |
priority: | undecided → low |
status: | new → assigned |
Another perspective on the test case: http://jsfiddle.net/rwaldron/NZdAa/4/
patch to follow
Changed October 30, 2011 05:15PM UTC by comment:3
milestone: | None → 1.next |
---|
Regardless of whether or not type coercion occurs within this function's body, the documented api says "index" which it defines as an "integer", but not as a string.
Changed November 05, 2011 09:50AM UTC by comment:4
Yes, I guess removing type coercion altogether would not be a bad idea.
Changed November 05, 2011 01:39PM UTC by comment:5
The patch fixes coercion support
Changed November 06, 2011 09:21PM UTC by comment:6
resolution: | → fixed |
---|---|
status: | assigned → closed |
Coerce eq() argument all the time. Fixes #10616
Changeset: 7cbd7a640fb6590b0eb7cbedd83a8d46eb553c5a
Changed November 06, 2011 10:05PM UTC by comment:7
milestone: | 1.next → 1.7.1 |
---|
Please see http://stackoverflow.com/questions/7939087/understanding-jquerys-eq/7939099#7939099 for further discussion.