]> source.dussan.org Git - jquery.git/commitdiff
Remove code for ticket #7717 which has been marked WONTFIX to match existing $.data...
authorColin Snover <github.com@zetafleet.com>
Wed, 22 Dec 2010 20:43:17 +0000 (14:43 -0600)
committerColin Snover <github.com@zetafleet.com>
Wed, 22 Dec 2010 20:43:17 +0000 (14:43 -0600)
src/manipulation.js
test/unit/manipulation.js

index 203d2ef725bbb02e05f2d2217097a77eee15faf6..3b9aa1462147d665ce9002e6937750869e3ab71b 100644 (file)
@@ -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 ) {
index 52f76ed6983b9e4cdf05189bee124611e93e7afc..ba57a6f91a0bc31500dbedb2d4c48773e4dd44c4 100644 (file)
@@ -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/";