Skip to content

Commit eefead3

Browse files
committed
Fixes #10952 by introducing a real fired flag in the Callbacks closure.
jQuery Size - compared to last make 250235 (+69) jquery.js 94225 (+7) jquery.min.js 33445 (+3) jquery.min.js.gz
1 parent 6eba066 commit eefead3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/callbacks.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jQuery.Callbacks = function( flags ) {
4848
stack = [],
4949
// Last fire value (for non-forgettable lists)
5050
memory,
51+
// Flag to know if list was already fired
52+
fired,
5153
// Flag to know if list is currently firing
5254
firing,
5355
// First callback to fire (used internally by add and fireWith)
@@ -81,6 +83,7 @@ jQuery.Callbacks = function( flags ) {
8183
fire = function( context, args ) {
8284
args = args || [];
8385
memory = !flags.memory || [ context, args ];
86+
fired = true;
8487
firing = true;
8588
firingIndex = firingStart || 0;
8689
firingStart = 0;
@@ -216,7 +219,7 @@ jQuery.Callbacks = function( flags ) {
216219
},
217220
// To know if the callbacks have already been called at least once
218221
fired: function() {
219-
return !!memory;
222+
return !!fired;
220223
}
221224
};
222225

0 commit comments

Comments
 (0)