outputB = addToOutput( "B" ),
outputC = addToOutput( "C" ),
tests = {
- "": "XABC X XABCABCC X XBB X XABA X",
- "once": "XABC X X X X X XABA X",
- "memory": "XABC XABC XABCABCCC XA XBB XB XABA XC",
- "unique": "XABC X XABCA X XBB X XAB X",
- "stopOnFalse": "XABC X XABCABCC X XBB X XA X",
- "once memory": "XABC XABC X XA X XA XABA XC",
- "once unique": "XABC X X X X X XAB X",
- "once stopOnFalse": "XABC X X X X X XA X",
- "memory unique": "XABC XA XABCA XA XBB XB XAB XC",
- "memory stopOnFalse": "XABC XABC XABCABCCC XA XBB XB XA X",
- "unique stopOnFalse": "XABC X XABCA X XBB X XA X"
+ "": "XABC X XABCABCC X XBB X XABA X XX",
+ "once": "XABC X X X X X XABA X XX",
+ "memory": "XABC XABC XABCABCCC XA XBB XB XABA XC XX",
+ "unique": "XABC X XABCA X XBB X XAB X X",
+ "stopOnFalse": "XABC X XABCABCC X XBB X XA X XX",
+ "once memory": "XABC XABC X XA X XA XABA XC XX",
+ "once unique": "XABC X X X X X XAB X X",
+ "once stopOnFalse": "XABC X X X X X XA X XX",
+ "memory unique": "XABC XA XABCA XA XBB XB XAB XC X",
+ "memory stopOnFalse": "XABC XABC XABCABCCC XA XBB XB XA X XX",
+ "unique stopOnFalse": "XABC X XABCA X XBB X XA X X"
},
filters = {
"no filter": undefined,
};
}
};
-
+
function showFlags( flags ) {
if ( typeof flags === "string" ) {
return '"' + flags + '"';
test( "jQuery.Callbacks( " + showFlags( flags ) + " ) - " + filterLabel, function() {
- expect( 20 );
+ expect( 21 );
// Give qunit a little breathing room
stop();
cblist.add( outputC );
strictEqual( output, results.shift(), "Adding a callback after one returned false" );
+ // Callbacks are not iterated
+ output = "";
+ function handler( tmp ) {
+ output += "X";
+ }
+ handler.method = function() {
+ output += "!";
+ };
+ cblist = jQuery.Callbacks( flags );
+ cblist.add( handler );
+ cblist.add( handler );
+ cblist.fire();
+ strictEqual( output, results.shift(), "No callback iteration" );
});
});
});