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

Throw error directly if it is the only thing passed in as the message #117

Merged
merged 1 commit into from Dec 22, 2014

Conversation

@ryanwilliamquinn
Copy link
Contributor

ryanwilliamquinn commented Dec 10, 2014

For #116

@mrlannigan

This comment has been minimized.

Copy link

mrlannigan commented Dec 16, 2014

👍

@hueniverse hueniverse added the feature label Dec 16, 2014
@ryanwilliamquinn

This comment has been minimized.

Copy link
Contributor Author

ryanwilliamquinn commented Dec 18, 2014

Using an error as the argument incurs a relatively significant performance issue - since the Error is created before the condition is even tested. This pull request slightly improves performance because the current code will create two error objects if the assertion fails. We are now thinking of making a different repository that pre-registers error types, and then just passes in a string key in the assert.

@nlf nlf self-assigned this Dec 22, 2014
@nlf nlf added this to the 2.11.0 milestone Dec 22, 2014
nlf added a commit that referenced this pull request Dec 22, 2014
Throw error directly if it is the only thing passed in as the message
@nlf nlf merged commit 7935d1f into hapijs:master Dec 22, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.