diff options
author | jaubourg <j@ubourg.net> | 2013-02-27 16:12:16 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2013-02-27 16:12:16 +0100 |
commit | a14a31727feed23c4ba4e4948700b7719ce219aa (patch) | |
tree | 985e24a490f11fa09615f761dac972eb0d91978e /test | |
parent | b6cfc0438e4e45dc719799774425841b7f22c02e (diff) | |
download | jquery-a14a31727feed23c4ba4e4948700b7719ce219aa.tar.gz jquery-a14a31727feed23c4ba4e4948700b7719ce219aa.zip |
Properly resets firingLength when emptying the list. Fixes #13517
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/callbacks.js | 16 |
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 ); |