aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2013-02-27 16:12:16 +0100
committerjaubourg <j@ubourg.net>2013-02-27 16:15:32 +0100
commit0618710913f41d7a7f4c095f0edda035e65a887d (patch)
tree89ace9aa0aed7577356572c33b43de6e9956252f /test/unit
parent1b6be73721270225fea8a182f4a57ae44f5e6405 (diff)
downloadjquery-0618710913f41d7a7f4c095f0edda035e65a887d.tar.gz
jquery-0618710913f41d7a7f4c095f0edda035e65a887d.zip
Properly resets firingLength when emptying the list. Fixes #13517
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/callbacks.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/callbacks.js b/test/unit/callbacks.js
index 9482832db..8962e5810 100644
--- a/test/unit/callbacks.js
+++ b/test/unit/callbacks.js
@@ -92,6 +92,22 @@ jQuery.each( tests, function( strFlags, resultString ) {
cblist.fire("A");
strictEqual( output, "X", "Firing after disabling" );
+ // #13517 - Emptying while firing
+ cblist = jQuery.Callbacks( flags );
+ cblist.add( cblist.empty );
+ cblist.add( function() {
+ ok( false, "not emptied" );
+ } );
+ cblist.fire();
+
+ // Disabling while firing
+ cblist = jQuery.Callbacks( flags );
+ cblist.add( cblist.disable );
+ cblist.add( function() {
+ ok( false, "not disabled" );
+ } );
+ cblist.fire();
+
// Basic binding and firing (context, arguments)
output = "X";
cblist = jQuery.Callbacks( flags );