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({
};
// Attach deferreds
deferred.promise( jqXHR ).complete = completeDeferred.add;
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
deferred.promise( jqXHR );
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (prefilters might expect it)
......@@ -620,9 +618,9 @@ jQuery.extend({
strAbort = "abort";
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
}
completeDeferred.add( s.complete );
jqXHR.done( s.success );
jqXHR.fail( s.error );
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
......
......@@ -72,11 +72,11 @@ module( "ajax", {
},
success: true,
afterSend: function( request ) {
request.complete(function() {
request.always(function() {
ok( true, "complete" );
}).success(function() {
}).done(function() {
ok( true, "success" );
}).error(function() {
}).fail(function() {
ok( false, "error" );
});
}
......@@ -90,11 +90,11 @@ module( "ajax", {
},
success: true,
complete: function( xhr ) {
xhr.complete(function() {
xhr.always(function() {
ok( true, "complete" );
}).success(function() {
}).done(function() {
ok( true, "success" );
}).error(function() {
}).fail(function() {
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