Makes sure statusCode callbacks are ordered in the same way success and error callbacks are. Unit tests added.
This commit is contained in:
parent
64e1cdbb95
commit
9ab00a712f
2 changed files with 34 additions and 7 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue