We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a0867d commit ab20d9dCopy full SHA for ab20d9d
src/deferred.js
@@ -132,9 +132,9 @@ jQuery.extend({
132
for ( ; i < length; i++ ) {
133
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
134
resolveValues[ i ].promise()
135
+ .progress( updateFunc( i, progressContexts, progressValues ) )
136
.done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject )
137
- .progress( updateFunc( i, progressContexts, progressValues ) );
+ .fail( deferred.reject );
138
} else {
139
--remaining;
140
}
test/unit/deferred.js
@@ -436,3 +436,25 @@ test( "jQuery.when - joined", function() {
436
deferreds.futureSuccess.resolve( 1 );
437
deferreds.futureError.reject( 0 );
438
});
439
+
440
+test( "jQuery.when - resolved", function() {
441
442
+ expect( 6 );
443
444
+ var a = jQuery.Deferred().notify( 1 ).resolve( 4 ),
445
+ b = jQuery.Deferred().notify( 2 ).resolve( 5 ),
446
+ c = jQuery.Deferred().notify( 3 ).resolve( 6 );
447
448
+ jQuery.when( a, b, c ).progress(function( a, b, c ) {
449
+ strictEqual( a, 1, "first notify value ok" );
450
+ strictEqual( b, 2, "second notify value ok" );
451
+ strictEqual( c, 3, "third notify value ok" );
452
+ }).done(function( a, b, c ) {
453
+ strictEqual( a, 4, "first resolve value ok" );
454
+ strictEqual( b, 5, "second resolve value ok" );
455
+ strictEqual( c, 6, "third resolve value ok" );
456
+ }).fail(function() {
457
+ ok( false, "Error on resolve" );
458
+ });
459
460
+});
0 commit comments