Side navigation
#9023 closed bug (invalid)
Opened April 30, 2011 12:45AM UTC
Closed April 30, 2011 01:17AM UTC
Last modified April 30, 2011 07:54PM UTC
jQuery.map( { length: 0 } )
| Reported by: | rkatic | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | core | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
IF
{ length: 3, 0: "a", 1: "b", 2: "c" } is array-like, then there is NO reason why
{ length: 0 } should not.
Attachments (0)
Change History (7)
Changed April 30, 2011 01:17AM UTC by comment:1
| component: | unfiled → core |
|---|---|
| priority: | undecided → low |
| resolution: | → invalid |
| status: | new → closed |
Changed April 30, 2011 01:28AM UTC by comment:2
| _comment0: | Disagree. \ \ "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." \ \ So { length: 0, "-1": "a" } is a an array? \ \ What? length = 0 is a special case?! \ \ → 1304188601872351 |
|---|---|
| _comment1: | Disagree. \ \ "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." \ \ So { length: 0, "-1": "a" } is a an array, but { length: 0 } not? \ \ What? length = 0 is a special case?! \ \ → 1304188626800188 |
| _comment2: | Disagree. \ \ "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." \ \ So { length: 0, "-1": "a" } is a an array, but { length: 0 } is not? \ \ What? length = 0 is a special case?! \ \ → 1304189398900547 |
Disagree.
"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."
So { length: 0, "-1": "a" } is a an array, but { length: 0 } is not?
Changed April 30, 2011 01:32AM UTC by comment:3
disagree all you want, I was simply quoting the docs.
Changed April 30, 2011 01:35AM UTC by comment:4
So, ipse dixit. That's your argument? Holy Docs.
Changed April 30, 2011 03:00AM UTC by comment:5
| _comment0: | Btw. fixing this would fix http://bugs.jquery.com/ticket/8995 too. → 1304133005262605 |
|---|---|
| _comment1: | Btw. fixing this would fix #8995 too. → 1304188799863097 |
| _comment2: | Btw. fixing this would fix #8993, #8995 too. → 1304188881027025 |
| _comment3: | Btw. fixing this would also fix #8993, #8995, #9025. → 1304384716955207 |
Changed April 30, 2011 09:27AM UTC by comment:6
| _comment0: | Another "not valid" test: http://bugs.jquery.com/ticket/9023 → 1304155831408170 |
|---|---|
| _comment1: | A real-world example: http://bugs.jquery.com/ticket/9023 → 1304189594998882 |
A real-world example: http://jsfiddle.net/8aLnP/ (FIXED LINK)
Consider the following:
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.
From http://api.jquery.com/jquery.map/
Your example does not meet the criteria and therefore is invalid.