From: Scott González Date: Tue, 28 Feb 2017 14:51:59 +0000 (-0500) Subject: Widget: Don't swallow errors in `remove` events X-Git-Tag: 1.13.0-alpha.1~86 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1f2011ece;p=jquery-ui.git 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 --- diff --git a/ui/widget.js b/ui/widget.js index a3922675f..726f70735 100644 --- a/ui/widget.js +++ b/ui/widget.js @@ -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 ); };