// Success/Error
if ( isSuccess ) {
- deferred.fire( callbackContext , [ success , statusText , jXHR ] );
+ deferred.resolveWith( callbackContext , [ success , statusText , jXHR ] );
} else {
- deferred.fireReject( callbackContext , [ jXHR , statusText , error ] );
+ deferred.rejectWith( callbackContext , [ jXHR , statusText , error ] );
}
// Status-dependent callbacks
}
// Complete
- completeDeferred.fire( callbackContext, [ jXHR , statusText ] );
+ completeDeferred.resolveWith( callbackContext, [ jXHR , statusText ] );
if ( s.global ) {
globalEventContext.trigger( "ajaxComplete" , [ jXHR , s] );
}
// If there are functions bound, to execute
- readyList.fire( document , [ jQuery ] );
+ readyList.resolveWith( document , [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
}
if ( _fired ) {
- deferred.fire( _fired[ 0 ] , _fired[ 1 ] );
+ deferred.resolveWith( _fired[ 0 ] , _fired[ 1 ] );
}
}
},
// resolve with given context and args
- fire: function( context , args ) {
+ resolveWith: function( context , args ) {
if ( ! cancelled && ! fired && ! firing ) {
firing = 1;
// resolve with this as context and given arguments
resolve: function() {
- deferred.fire( jQuery.isFunction( this.promise ) ? this.promise() : this , arguments );
+ deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this , arguments );
return this;
},
return this;
},
fail: failDeferred.done,
- fireReject: failDeferred.fire,
+ rejectWith: failDeferred.resolveWith,
reject: failDeferred.resolve,
isRejected: failDeferred.isResolved,
// Get a promise for this deferred
args = arguments;
resolveArray[ index ] = args.length > 1 ? slice.call( args , 0 ) : value;
if( ! --length ) {
- deferred.fire( promise, resolveArray );
+ deferred.resolveWith( promise, resolveArray );
}
}).fail( function() {
- deferred.fireReject( promise, arguments );
+ deferred.rejectWith( promise, arguments );
});
return !deferred.isRejected();
});
deferred = jQuery._Deferred();
- deferred.fire( jQuery , [ document ] ).done( function( doc ) {
+ deferred.resolveWith( jQuery , [ document ] ).done( function( doc ) {
ok( this === jQuery && arguments.length === 1 && doc === document , "Test fire context & args" );
});
});