Skip to content
Permalink
Browse files

We removed deleteExpando after 1.4.2, for some reason. This caused pr…

…oblems with removeData() (no arguments). Fixes #7209.
  • Loading branch information...
jeresig committed Oct 17, 2010
1 parent 2582876 commit e1b940d74824282fd3466d39a8ab574da4ef6fc5
Showing with 16 additions and 1 deletion.
  1. +10 −0 src/support.js
  2. +6 −1 test/unit/data.js
@@ -61,6 +61,7 @@
optSelected: opt.selected,

// Will be defined later
deleteExpando: true,
optDisabled: false,
checkClone: false,
scriptEval: false,
@@ -91,6 +92,15 @@
delete window[ id ];
}

// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete script.test;

} catch(e) {
jQuery.support.deleteExpando = false;
}

root.removeChild( script );

if ( div.attachEvent && div.fireEvent ) {
@@ -284,11 +284,16 @@ test(".data(Object)", function() {
});

test("jQuery.removeData", function() {
expect(5);
expect(7);
var div = jQuery("#foo")[0];
jQuery.data(div, "test", "testing");
jQuery.removeData(div, "test");
equals( jQuery.data(div, "test"), undefined, "Check removal of data" );

jQuery.data(div, "test2", "testing");
jQuery.removeData( div );
ok( !jQuery.data(div, "test2"), "Make sure that the data property no longer exists." );
ok( !div[ jQuery.expando ], "Make sure the expando no longer exists, as well." );

var obj = {};
jQuery.data(obj, "test", "testing");

0 comments on commit e1b940d

Please sign in to comment.
You can’t perform that action at this time.