Opened 12 years ago

Closed 12 years ago

#4581 closed defect (invalid)

2nd callback does not receive parameters on dojo.deferred

Reported by: guest Owned by: Dustin Machi
Priority: high Milestone: 1.0
Component: Core Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

Reproduce

        var obj1 = {
            f:function(param) {
                console.debug("obj1.f received:"+param);
            }
        };
        var obj2 = {
            f:function(param) {
                console.debug("obj2.f received:"+param);
            }
        };
        var deferred = new dojo.Deferred();
        deferred.addCallback(obj1, obj1.f);
        deferred.addCallback(obj2, obj1.f);
        deferred.callback("bla");

returns

obj1.f received:bla
obj1.f received:undefined

It should return

obj1.f received:bla
obj1.f received:bla

Change History (3)

comment:1 Changed 12 years ago by dylan

Owner: changed from anonymous to Dustin Machi

comment:2 Changed 12 years ago by guest

This was on nightly build 27.09.2007

comment:3 Changed 12 years ago by Dustin Machi

Resolution: invalid
Status: newclosed

Deferred callbacks are chained to one another (the the output of the first item in the chain gets passed as the input to the second item in the chain). Therefore this behavior is correct. In order to make it do what you are trying to do, you would need to have obj1's f() have a return param; in it.

Note: See TracTickets for help on using tickets.