Commit 93beee8a authored by rwldrn's avatar rwldrn

Test for window inference. Fixes #10080

parent f44d5e1e
...@@ -191,8 +191,8 @@ jQuery.extend({ ...@@ -191,8 +191,8 @@ jQuery.extend({
// Browsers that fail expando deletion also refuse to delete expandos on // 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 // the window, but it will allow it on all other JS objects; other browsers
// don't care // don't care
// Ensure that this id actually exists in `cache` #10080 // Ensure that `cache` is not a window object #10080
if ( cache[ id ] && ( jQuery.support.deleteExpando || cache != window ) ) { if ( jQuery.support.deleteExpando || !cache.setInterval ) {
delete cache[ id ]; delete cache[ id ];
} else { } else {
cache[ id ] = null; cache[ id ] = null;
......
...@@ -582,3 +582,16 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert ...@@ -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");
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment