mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Adds a unit test to control options are being copied by jQuery.Callbacks internally.
This commit is contained in:
parent
ad329384ff
commit
d17a7f04d4
@ -203,3 +203,21 @@ jQuery.each( tests, function( strFlags, resultString ) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
test( "jQuery.Callbacks( options ) - options are copied", function() {
|
||||||
|
|
||||||
|
expect( 1 );
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
memory: true
|
||||||
|
},
|
||||||
|
cb = jQuery.Callbacks( options );
|
||||||
|
|
||||||
|
options.memory = false;
|
||||||
|
|
||||||
|
cb.fire( "hello" );
|
||||||
|
|
||||||
|
cb.add(function( hello ) {
|
||||||
|
strictEqual( hello, "hello", "options are copied internally" );
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user