Skip to content
Permalink
Browse files

Merge pull request #468 from rwldrn/10080

Fixes #10080. Test cache for window inference.
  • Loading branch information...
dmethvin committed Aug 25, 2011
2 parents 979dd1c + 93beee8 commit f4811bfb04206b9d9c120001603eadb1b529c271
Showing with 15 additions and 1 deletion.
  1. +2 −1 src/data.js
  2. +13 −0 test/unit/data.js
@@ -191,7 +191,8 @@ jQuery.extend({
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS objects; other browsers
// don't care
if ( jQuery.support.deleteExpando || cache != window ) {
// Ensure that `cache` is not a window object #10080
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
delete cache[ id ];
} else {
cache[ id ] = null;
@@ -582,3 +582,16 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert

});
});

// Test originally by Moschel
test("Triggering the removeData should not throw exceptions. (#10080)", function() {
expect(1);
stop();
var frame = jQuery("#loadediframe");
jQuery(frame[0].contentWindow).bind("unload", function() {
ok(true, "called unload");
start();
});
// change the url to trigger unload
frame.attr("src", "data/iframe.html?param=true");
});

0 comments on commit f4811bf

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.