Remove code for ticket #7717 which has been marked WONTFIX to match existing $.data functionality and to prevent infinite loops caused by circular references.
This commit is contained in:
parent
2a47ceae5b
commit
445fdf720c
|
@ -382,7 +382,7 @@ function cloneCopyEvent(orig, ret) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var oldData = jQuery.data( orig[nodeIndex] ),
|
var oldData = jQuery.data( orig[nodeIndex] ),
|
||||||
curData = jQuery.data( this, jQuery.extend(true, {}, oldData) ),
|
curData = jQuery.data( this, oldData ),
|
||||||
events = oldData && oldData.events;
|
events = oldData && oldData.events;
|
||||||
|
|
||||||
if ( events ) {
|
if ( events ) {
|
||||||
|
|
|
@ -924,16 +924,12 @@ test("clone()", function() {
|
||||||
equals( clone.html(), div.html(), "Element contents cloned" );
|
equals( clone.html(), div.html(), "Element contents cloned" );
|
||||||
equals( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
|
equals( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
|
||||||
|
|
||||||
div = jQuery("<div/>").data({
|
div = jQuery("<div/>").data({ a: true });
|
||||||
a: true, b: true,
|
|
||||||
c: { nesty: ["Block", "Head"] }
|
|
||||||
});
|
|
||||||
var div2 = div.clone(true);
|
var div2 = div.clone(true);
|
||||||
equals( div2.data("a"), true, "Data cloned." );
|
equals( div2.data("a"), true, "Data cloned." );
|
||||||
equals( div2.data("b"), true, "Data cloned." );
|
div2.data("a", false);
|
||||||
var c = div2.data("c");
|
equals( div2.data("a"), false, "Ensure cloned element data object was correctly modified" );
|
||||||
c.nesty[0] = "Fish";
|
equals( div.data("a"), true, "Ensure cloned element data object is copied, not referenced" );
|
||||||
equals( div.data("c").nesty[0], "Block", "Ensure cloned element data is deep copied (Bug #7717)" );
|
|
||||||
|
|
||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.action = "/test/";
|
form.action = "/test/";
|
||||||
|
|
Loading…
Reference in a new issue