From 1f2011ece3fe6847874677e9a8210fa202498ccb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 28 Feb 2017 09:51:59 -0500 Subject: [PATCH] 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 --- ui/widget.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 ); }; -- 2.39.5