Skip to content

Throw if performFn is valid but callback is not#13

Open
NealEhardt wants to merge 2 commits intobmeck:masterfrom
NealEhardt:master
Open

Throw if performFn is valid but callback is not#13
NealEhardt wants to merge 2 commits intobmeck:masterfrom
NealEhardt:master

Conversation

@NealEhardt
Copy link

Add error checking for the following scenario:

actor.perform('action-name', function () {}, 'INVALID CALLBACK');

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe you also want to make the same change you made to the actor.before statement above.

Copy link
Author

Choose a reason for hiding this comment

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

If you look at the file after changes, I deleted actor.after and modified actor.before. I think actor.after is redundant in this case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not redundant. It's an additional assertion that should never be hit: after hooks should not be executed. If they are it's a bug.

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.

2 participants