Ticket #4581 (closed defect: invalid)

Opened 14 months ago

Last modified 14 months ago

2nd callback does not receive parameters on dojo.deferred

Reported by: guest Owned by: dmachi
Priority: high Milestone: 1.0
Component: Core Version: 0.9
Severity: major Keywords:
Cc:

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

Changed 14 months ago by dylan

  • owner changed from anonymous to dmachi

Changed 14 months ago by guest

This was on nightly build 27.09.2007

Changed 14 months ago by dmachi

  • status changed from new to closed
  • resolution set to invalid

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.