Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose patched method/function name in aspects API #49

Merged
merged 1 commit into from
Nov 10, 2015

Conversation

seabaylea
Copy link
Member

This provides the "methodName" that's been patched to the function callbacks to the aspects.before(), aspects.after() and aspects.around() calls so that its possible to know which function is being patched if an array of function names was provided.

Its passed as the new last parameter to avoid affecting existing code that uses the aspects calls.

@seabaylea
Copy link
Member Author

@tunniclm Can you review this as the fix for issue #46

@@ -85,7 +85,7 @@ exports.aroundCallback = function(args, hookBefore, hookAfter) {
var ret = orig.apply(this, arguments);

if(hookAfter) {
hookAfter(this, arguments);
hookAfter(this, arguments, ret);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seabaylea Is this change another fix? It doesn't look related to the method name change, unless I'm missing something?

@seabaylea
Copy link
Member Author

Yeah, its a "small fix" which didn't look like it really deserved its own issue... hookAfter should have three parameters: this, arguments and return value. For some reason that call was missing the return value.

@tunniclm
Copy link
Contributor

OK, LGTM then. Are you ready for it to be merged?

@seabaylea
Copy link
Member Author

Yup - it should be good to go.

tunniclm added a commit that referenced this pull request Nov 10, 2015
Expose patched method/function name in aspects API
@tunniclm tunniclm merged commit 3f2a214 into RuntimeTools:master Nov 10, 2015
@seabaylea seabaylea deleted the function-name branch November 10, 2015 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants