Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove code for ticket #7717 which has been marked WONTFIX to match e…

…xisting $.data functionality and to prevent infinite loops caused by circular references.
  • Loading branch information...
commit 4993f75a882c9bcc20ecf2e823328a4b16c0a52b 1 parent 9ed0c71
@csnover csnover authored
Showing with 5 additions and 9 deletions.
  1. +1 −1  src/manipulation.js
  2. +4 −8 test/unit/manipulation.js
View
2  src/manipulation.js
@@ -382,7 +382,7 @@ function cloneCopyEvent(orig, ret) {
}
var oldData = jQuery.data( orig[nodeIndex] ),
- curData = jQuery.data( this, jQuery.extend(true, {}, oldData) ),
+ curData = jQuery.data( this, oldData ),
events = oldData && oldData.events;
if ( events ) {
View
12 test/unit/manipulation.js
@@ -924,16 +924,12 @@ test("clone()", function() {
equals( clone.html(), div.html(), "Element contents cloned" );
equals( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
- div = jQuery("<div/>").data({
- a: true, b: true,
- c: { nesty: ["Block", "Head"] }
- });
+ div = jQuery("<div/>").data({ a: true });
var div2 = div.clone(true);
equals( div2.data("a"), true, "Data cloned." );
- equals( div2.data("b"), true, "Data cloned." );
- var c = div2.data("c");
- c.nesty[0] = "Fish";
- equals( div.data("c").nesty[0], "Block", "Ensure cloned element data is deep copied (Bug #7717)" );
+ div2.data("a", false);
+ equals( div2.data("a"), false, "Ensure cloned element data object was correctly modified" );
+ equals( div.data("a"), true, "Ensure cloned element data object is copied, not referenced" );
var form = document.createElement("form");
form.action = "/test/";
Please sign in to comment.
Something went wrong with that request. Please try again.