File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -191,8 +191,8 @@ jQuery.extend({
191191 // Browsers that fail expando deletion also refuse to delete expandos on
192192 // the window, but it will allow it on all other JS objects; other browsers
193193 // don't care
194- // Ensure that this id actually exists in `cache` #10080
195- if ( cache [ id ] && ( jQuery . support . deleteExpando || cache != window ) ) {
194+ // Ensure that `cache` is not a window object #10080
195+ if ( jQuery . support . deleteExpando || ! cache . setInterval ) {
196196 delete cache [ id ] ;
197197 } else {
198198 cache [ id ] = null ;
Original file line number Diff line number Diff line change @@ -582,3 +582,16 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert
582582
583583 } ) ;
584584} ) ;
585+
586+ // Test originally by Moschel
587+ test ( "Triggering the removeData should not throw exceptions. (#10080)" , function ( ) {
588+ expect ( 1 ) ;
589+ stop ( ) ;
590+ var frame = jQuery ( "#loadediframe" ) ;
591+ jQuery ( frame [ 0 ] . contentWindow ) . bind ( "unload" , function ( ) {
592+ ok ( true , "called unload" ) ;
593+ start ( ) ;
594+ } ) ;
595+ // change the url to trigger unload
596+ frame . attr ( "src" , "data/iframe.html?param=true" ) ;
597+ } ) ;
You can’t perform that action at this time.
0 commit comments