Opened 13 years ago
Closed 12 years ago
#6675 closed bug (fixed)
makeArray fails on objects with a length property
Reported by: | 314159abcde | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.4.3 |
Component: | core | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Try:
jQuery.makeArray( {'length':5} );
in the firebug console on any jQuery site and it will output [undefined, undefined, undefined, undefined, undefined]
when it should return [Object { length=5}]
This is causing issues where I have an object with a length and width attribute, since it will not pass through makeArray properly.
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Never mind. I misread your post. Please scratch the previous comment
comment:3 Changed 12 years ago by
Priority: | → undecided |
---|---|
Resolution: | → fixed |
Status: | new → closed |
As Kiyoto has already applied a patch for this to achieve the desired effect, I am updating this ticket to fixed. Please re-submit/re-open if required.
Note: See
TracTickets for help on using
tickets.
What is the expected behavior here? I changed line 650-652 of src/core.js to
else {
This will get the desired behavior for your case, but it breaks a slew of jQuery test cases. I was wondering what the expected behavior for jQuery.makeArray({'length':3}) was.