Modify ↓
Ticket #1907 (closed bug: fixed)
jQuery.extend() deep destroys array of zero
| Reported by: | genezys | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | core | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
jQuery.extend(true, {plop:[]}, {plop:[0]})
returns an object where plop is an empty array.
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.

It appears this is a coersion problem. In jQuery.extend there is a section
Coersion says that [] is false and 0 is false. So they are equal. This test should probably use === instead.