Permalink
Browse files

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
  • Loading branch information...
scottgonzalez committed Feb 28, 2017
1 parent 278d1e1 commit 1f2011ece3fe6847874677e9a8210fa202498ccb
Showing with 5 additions and 9 deletions.
  1. +5 −9 ui/widget.js
View
@@ -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 );
};

0 comments on commit 1f2011e

Please sign in to comment.