Skip to content

Commit 3a6b759

Browse files
committed
Removes definition of createList and use jQuery.Callbacks directly to make things a bit less obfuscated.
1 parent 198290a commit 3a6b759

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

test/unit/callbacks.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ var output,
4040

4141
jQuery.each( tests, function( flags, resultString ) {
4242

43-
function createList() {
44-
return jQuery.Callbacks( flags );
45-
}
46-
4743
jQuery.each( filters, function( filterLabel, filter ) {
4844

4945
test( "jQuery.Callbacks( \"" + flags + "\" ) - " + filterLabel, function() {
@@ -59,7 +55,7 @@ jQuery.each( tests, function( flags, resultString ) {
5955

6056
// Basic binding and firing
6157
output = "X";
62-
cblist = createList();
58+
cblist = jQuery.Callbacks( flags );
6359
cblist.add(function( str ) {
6460
output += str;
6561
});
@@ -76,7 +72,7 @@ jQuery.each( tests, function( flags, resultString ) {
7672

7773
// Basic binding and firing (context, arguments)
7874
output = "X";
79-
cblist = createList();
75+
cblist = jQuery.Callbacks( flags );
8076
cblist.add(function() {
8177
equals( this, window, "Basic binding and firing (context)" );
8278
output += Array.prototype.join.call( arguments, "" );
@@ -86,7 +82,7 @@ jQuery.each( tests, function( flags, resultString ) {
8682

8783
// fireWith with no arguments
8884
output = "";
89-
cblist = createList();
85+
cblist = jQuery.Callbacks( flags );
9086
cblist.add(function() {
9187
equals( this, window, "fireWith with no arguments (context is window)" );
9288
strictEqual( arguments.length, 0, "fireWith with no arguments (no arguments)" );
@@ -95,7 +91,7 @@ jQuery.each( tests, function( flags, resultString ) {
9591

9692
// Basic binding, removing and firing
9793
output = "X";
98-
cblist = createList();
94+
cblist = jQuery.Callbacks( flags );
9995
cblist.add( outputA );
10096
cblist.add( outputB );
10197
cblist.add( outputC );
@@ -105,7 +101,7 @@ jQuery.each( tests, function( flags, resultString ) {
105101

106102
// Empty
107103
output = "X";
108-
cblist = createList();
104+
cblist = jQuery.Callbacks( flags );
109105
cblist.add( outputA );
110106
cblist.add( outputB );
111107
cblist.add( outputC );
@@ -115,7 +111,7 @@ jQuery.each( tests, function( flags, resultString ) {
115111

116112
// Locking
117113
output = "X";
118-
cblist = createList();
114+
cblist = jQuery.Callbacks( flags );
119115
cblist.add( function( str ) {
120116
output += str;
121117
});
@@ -131,7 +127,7 @@ jQuery.each( tests, function( flags, resultString ) {
131127

132128
// Ordering
133129
output = "X";
134-
cblist = createList();
130+
cblist = jQuery.Callbacks( flags );
135131
cblist.add( function() {
136132
cblist.add( outputC );
137133
outputA();
@@ -153,7 +149,7 @@ jQuery.each( tests, function( flags, resultString ) {
153149

154150
// Multiple fire
155151
output = "X";
156-
cblist = createList();
152+
cblist = jQuery.Callbacks( flags );
157153
cblist.add( function( str ) {
158154
output += str;
159155
} );

0 commit comments

Comments
 (0)