mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Regression: makes sure that all instances of a callback are removed. Unit test added.
This commit is contained in:
@@ -235,3 +235,18 @@ test( "jQuery.Callbacks.fireWith - arguments are copied", function() {
|
||||
strictEqual( hello, "hello", "arguments are copied internally" );
|
||||
});
|
||||
});
|
||||
|
||||
test( "jQuery.Callbacks.remove - should remove all instances", function() {
|
||||
|
||||
expect( 1 );
|
||||
|
||||
var cb = jQuery.Callbacks();
|
||||
|
||||
function fn() {
|
||||
ok( false, "function wasn't removed" );
|
||||
}
|
||||
|
||||
cb.add( fn, fn, function() {
|
||||
ok( true, "end of test" );
|
||||
}).remove( fn ).fire();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user