Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
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.