Commit 9368a8cd authored by Oleg Gaidarenko's avatar Oleg Gaidarenko

Ajax: remove deprecated extensions from ajax promise

(cherry-picked from 9d1b989f20b550af3590691723b0620f6914626e)
Fixes gh-2084
Closes gh-2092
parent 04fc8012
...@@ -488,9 +488,7 @@ jQuery.extend({ ...@@ -488,9 +488,7 @@ jQuery.extend({
}; };
// Attach deferreds // Attach deferreds
deferred.promise( jqXHR ).complete = completeDeferred.add; deferred.promise( jqXHR );
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
// Remove hash character (#7531: and string promotion) // Remove hash character (#7531: and string promotion)
// Add protocol if not provided (prefilters might expect it) // Add protocol if not provided (prefilters might expect it)
...@@ -620,9 +618,9 @@ jQuery.extend({ ...@@ -620,9 +618,9 @@ jQuery.extend({
strAbort = "abort"; strAbort = "abort";
// Install callbacks on deferreds // Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) { completeDeferred.add( s.complete );
jqXHR[ i ]( s[ i ] ); jqXHR.done( s.success );
} jqXHR.fail( s.error );
// Get transport // Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
......
...@@ -72,11 +72,11 @@ module( "ajax", { ...@@ -72,11 +72,11 @@ module( "ajax", {
}, },
success: true, success: true,
afterSend: function( request ) { afterSend: function( request ) {
request.complete(function() { request.always(function() {
ok( true, "complete" ); ok( true, "complete" );
}).success(function() { }).done(function() {
ok( true, "success" ); ok( true, "success" );
}).error(function() { }).fail(function() {
ok( false, "error" ); ok( false, "error" );
}); });
} }
...@@ -90,11 +90,11 @@ module( "ajax", { ...@@ -90,11 +90,11 @@ module( "ajax", {
}, },
success: true, success: true,
complete: function( xhr ) { complete: function( xhr ) {
xhr.complete(function() { xhr.always(function() {
ok( true, "complete" ); ok( true, "complete" );
}).success(function() { }).done(function() {
ok( true, "success" ); ok( true, "success" );
}).error(function() { }).fail(function() {
ok( false, "error" ); ok( false, "error" );
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment