Makes sure statusCode callbacks are ordered in the same way success and error callbacks are. Unit tests added.

This commit is contained in:
jaubourg 2011-01-20 15:39:30 +01:00
parent 64e1cdbb95
commit 9ab00a712f
2 changed files with 34 additions and 7 deletions

View file

@ -427,10 +427,8 @@ jQuery.extend({
// Stored error
error,
// Keep track of statusCode callbacks
oldStatusCode = statusCode;
statusCode = undefined;
// To keep track of statusCode based callbacks
oldStatusCode;
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
@ -588,6 +586,8 @@ jQuery.extend({
}
// Status-dependent callbacks
oldStatusCode = statusCode;
statusCode = undefined;
jXHR.statusCode( oldStatusCode );
if ( s.global ) {