Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10723 closed bug (fixed)

jqXHR.always() returns a Promise instead of a jqXHR object

Reported by: madblueimp Owned by: jaubourg
Priority: blocker Milestone: 1.7.1
Component: ajax Version: 1.7
Keywords: Cc: jaubourg
Blocked by: Blocking:

Description

Test case:

$.get().always($.noop).abort();

Expected behavior: Aborts the GET request.

Observed behavior:

TypeError: Object #<Object> has no method 'abort'

Change History (6)

comment:1 Changed 6 years ago by timmywil

Cc: jaubourg added
Component: unfiledajax
Keywords: needsreview added
Priority: undecidedlow
Status: newopen

.always() returns the deferred without the methods added using deferred.promise( jqXHR ) internally. I 'defer' to jaubourg here. It may be worth defer.promise extending the actual deferred rather than creating a new object so that the jqXHR can be chained.

comment:2 Changed 6 years ago by dmethvin

#10728 is a duplicate of this ticket.

comment:3 Changed 6 years ago by jaubourg

Keywords: needsreview removed
Milestone: None1.7.1
Owner: set to jaubourg
Priority: lowblocker
Status: openassigned

comment:4 Changed 6 years ago by jaubourg

Resolution: fixed
Status: assignedclosed

Have Deferred.always return the object onto which it is currently attached to enable true chainability. Fixes #10723. Unit tests added.

Changeset: 2a9f0681dee3a6421bafd2fbc4451c9fe364b6ca

comment:5 Changed 6 years ago by timmywil

#10738 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.