]> source.dussan.org Git - jquery.git/commitdiff
Use real declaration since that helps gzip: thanks @gibson042.
authorjaubourg <j@ubourg.net>
Wed, 25 Apr 2012 15:15:48 +0000 (17:15 +0200)
committerjaubourg <j@ubourg.net>
Wed, 25 Apr 2012 15:15:48 +0000 (17:15 +0200)
src/callbacks.js

index bf51ad54924893fc6d12acb226d776502bf0334c..42f9315e95b15e7a99728eb408bc6e9e96ff70d0 100644 (file)
@@ -93,7 +93,8 @@ jQuery.Callbacks = function( options ) {
                                        // First, we save the current length
                                        var start = list.length;
                                        (function add( args ) {
-                                               jQuery.each( args, function( type, arg ) {
+                                               jQuery.each( args, function( _, arg ) {
+                                                       var type;
                                                        if ( ( type = jQuery.type(arg) ) === "array" ) {
                                                                // Inspect recursively
                                                                add( arg );
@@ -119,8 +120,9 @@ jQuery.Callbacks = function( options ) {
                        // Remove a callback from the list
                        remove: function() {
                                if ( list ) {
-                                       jQuery.each( arguments, function( _, arg, index ) {
-                                               while( ( index = jQuery.inArray( arg, list, index || 0 ) ) > -1 ) {
+                                       jQuery.each( arguments, function( _, arg ) {
+                                               var index = 0;
+                                               while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
                                                        list.splice( index, 1 );
                                                        // Handle firing indexes
                                                        if ( firing ) {