Bug Tracker

Modify

Ticket #8161 (closed bug: duplicate)

Opened 2 years ago

Last modified 2 years ago

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:1 follow-up: ↓ 2 Changed 2 years ago by RwwL

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

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.

comment:3 Changed 2 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to manipulation

comment:4 Changed 2 years ago by rwaldron

Duplicate of #8123.

comment:5 Changed 2 years ago by jitter

  • Milestone changed from 1.next to 1.5.1

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.