Opened 8 years ago

Closed 8 years ago

#15425 closed defect (invalid)

dojo/aspect receiveArguments parameter

Reported by: dojonovice@… Owned by: dojonovice@…
Priority: undecided Milestone: tbd
Component: Core Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

When I use dojo/aspect without receiveArguments parameter or false value and call object method with arguments, the aspect function pass these arguments into function too. Why? is it bug or normal behaviour?

require(["dojo/ready", "dojo/aspect"], function(ready, aspect) {

ready(function() {

var Aspect_obj = {

method : function(param1, param2) {

console.log("Aspect_obj method " + param1 + ", " + param2);

}

} function callMe(param1, param2) {

console.log("callMe function " + param1 + ", " + param2);

}

aspect.before(Aspect_obj, "method", callMe, false); Aspect_obj.method(1, 2); console.log("--------------------------");

aspect.after(Aspect_obj, "method", callMe); Aspect_obj.method(1, 2);

});

});

Change History (3)

comment:1 Changed 8 years ago by bill

Owner: set to dojonovice@…
Status: newpending

before() doesn't have a receiveArguments parameter (again, see the documentation). are you having an issue with aspect.after()?

comment:2 Changed 8 years ago by dojonovice@…

Status: pendingnew

I test it again and before() method is ok. I have read a non-dojo docs article and thought that (target, methodName, advisingFunction, receiveArguments) is for all methods of dojo/aspect. You can delete this ticket.

comment:3 Changed 8 years ago by bill

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.