Bug Tracker

Opened 6 years ago

Closed 6 years ago

#13966 closed bug (notabug)

Deferred done handler’s context has changed

Reported by: marlun78@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

The context (”this”) in the done handler has changed.

Example: http://jsfiddle.net/AL7B2/

The problem seem to be at line 1237 (in the Deferred function).

Code in 1.8:

// deferred[ resolve | reject | notify ] = list.fire
deferred[ tuple[0] ] = list.fire;

Code in 1.9+:

// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
	deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
	return this;
};

I found this issue in 1.9.1, but it seem to be pressent in 1.10 and 1.0 too.

Change History (2)

comment:1 Changed 6 years ago by marlun78@…

I ment ... it seem to be pressent in 1.10 and 2.0 too.

comment:2 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

See #11405. Custom data could be attached to the promise.

Note: See TracTickets for help on using tickets.