]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: Don't swallow errors in `remove` events
authorScott González <scott.gonzalez@gmail.com>
Tue, 28 Feb 2017 14:51:59 +0000 (09:51 -0500)
committerScott González <scott.gonzalez@gmail.com>
Tue, 28 Feb 2017 14:51:59 +0000 (09:51 -0500)
The try/catch was only there to support jQuery <1.6.3, which we no
longer support.

Ref jquery/jquery#3554

ui/widget.js

index a3922675f1d8e884ec7873d527963cd18d978a0f..726f70735c98fa2569dfb910bfd3ddfc12056f9d 100644 (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 );
        };