Ticket #8161 (closed bug: duplicate)
clone() api docs don't match behavior
| Reported by: | RwwL | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.5.1 |
| Component: | manipulation | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The API docs as of 1.5 say that withDataAndEvents and deepWithDataAndEvents both default to false. However, they're both defaulting to true (lines 5139 and 5140):
dataAndEvents = dataAndEvents == null ? true : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents :
If you call .clone() in 1.5 with no arguments, dataAndEvents is undefined, and undefined == null evaluates to true, so the default value winds up being true.
Not sure what the intent is, so I can't say if this is a typo in the docs are or of the code should change, but it seems like one of them should.
Change History
comment:2 in reply to: ↑ 1 Changed 2 years ago by RwwL
Replying to RwwL:
Gah. Sorry for the crappy formatting in the ticket and the mangled last sentence.
AND sorry, I now see it's another duplicate of http://bugs.jquery.com/ticket/8123 -- don't know how I missed that, I really did try a search.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Gah. Sorry for the crappy formatting in the ticket and the mangled last sentence.