Permalink
Browse files

Data: restore explicit data removal of private data in cleanData.

Fixes gh-2127
Closes gh-2132
  • Loading branch information...
rwaldron authored and gibson042 committed Mar 9, 2015
1 parent 9b03f6d commit 332fd941b4ae80e8ca5e5a20aca91806038f4816
Showing with 18 additions and 1 deletion.
  1. +1 −1 src/manipulation.js
  2. +17 −0 test/unit/manipulation.js
View
@@ -305,7 +305,7 @@ jQuery.extend({
}
}
}
delete data.events;
delete elem[ dataPriv.expando ];
}
}
}
View
@@ -2047,6 +2047,23 @@ test( "jQuery.cleanData", function() {
}
});
test( "jQuery.cleanData eliminates all private data (gh-2127)", function() {
expect( 2 );
var div = jQuery( "<div/>" ).appendTo( "#qunit-fixture" );
jQuery._data( div[ 0 ], "gh-2127", "testing" );
ok( !jQuery.isEmptyObject( jQuery._data( div[ 0 ] ) ), "Ensure some private data exists" );
div.remove();
ok( jQuery.isEmptyObject( jQuery._data( div[ 0 ] ) ),
"Private data is empty after node is removed" );
div.remove();
});
test( "jQuery.buildFragment - no plain-text caching (Bug #6779)", function() {
expect( 1 );

0 comments on commit 332fd94

Please sign in to comment.