Skip to content

Commit

Permalink
Fixes #10952 by introducing a real fired flag in the Callbacks closure.
Browse files Browse the repository at this point in the history
jQuery Size - compared to last make
  250235    (+69) jquery.js
   94225     (+7) jquery.min.js
   33445     (+3) jquery.min.js.gz
  • Loading branch information
jaubourg committed Jan 31, 2012
1 parent 6eba066 commit eefead3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/callbacks.js
Expand Up @@ -48,6 +48,8 @@ jQuery.Callbacks = function( flags ) {
stack = [], stack = [],
// Last fire value (for non-forgettable lists) // Last fire value (for non-forgettable lists)
memory, memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing // Flag to know if list is currently firing
firing, firing,
// First callback to fire (used internally by add and fireWith) // First callback to fire (used internally by add and fireWith)
Expand Down Expand Up @@ -81,6 +83,7 @@ jQuery.Callbacks = function( flags ) {
fire = function( context, args ) { fire = function( context, args ) {
args = args || []; args = args || [];
memory = !flags.memory || [ context, args ]; memory = !flags.memory || [ context, args ];
fired = true;
firing = true; firing = true;
firingIndex = firingStart || 0; firingIndex = firingStart || 0;
firingStart = 0; firingStart = 0;
Expand Down Expand Up @@ -216,7 +219,7 @@ jQuery.Callbacks = function( flags ) {
}, },
// To know if the callbacks have already been called at least once // To know if the callbacks have already been called at least once
fired: function() { fired: function() {
return !!memory; return !!fired;
} }
}; };


Expand Down

0 comments on commit eefead3

Please sign in to comment.