Ticket #11405 (closed bug: fixed)
deferred.notify() invokes progressCallbacks with deferred as context
|Reported by:||fastfasterfastest||Owned by:||jaubourg|
http://api.jquery.com/deferred.promise states: "The deferred.promise() method allows an asynchronous function to prevent other code from interfering with the progress or status of its internal request"
However, deferred.notify() invokes progressCallbacks with the deferred as the context, allowing other code to interfere with the progress or status of the internal request of the deferred object.
http://jsfiddle.net/d92Rp/1/ shows how a progress callback is able to reject a deferred.
Arguably, it would make more sense to invoke the progressCallbacks with the promise of the deferred (deferred.promise()) as the context.
The same perhaps/probably applies to deferred.resolve() and deferred.reject(), although in those cases any calls by the done or fail callbacks to resolve or reject would have no effect.
- Cc jaubourg added
- Priority changed from undecided to low
- Component changed from unfiled to ajax
- Owner set to jaubourg
- Status changed from new to assigned
- Priority changed from low to high
- Milestone changed from None to 1.9