Widget: Don't swallow errors in remove events

The try/catch was only there to support jQuery <1.6.3, which we no
longer support.

Ref jquery/jquery#3554
This commit is contained in:
Scott González 2017-02-28 09:51:59 -05:00
parent 278d1e1108
commit 1f2011ece3

View File

@ -32,16 +32,12 @@ $.cleanData = ( function( orig ) {
return function( elems ) {
var events, elem, i;
for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
try {
// Only trigger remove when necessary to save time
events = $._data( elem, "events" );
if ( events && events.remove ) {
$( elem ).triggerHandler( "remove" );
}
// Http://bugs.jquery.com/ticket/8235
} catch ( e ) {}
// Only trigger remove when necessary to save time
events = $._data( elem, "events" );
if ( events && events.remove ) {
$( elem ).triggerHandler( "remove" );
}
}
orig( elems );
};