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

[BUGFIX beta] Update Registry#has to always return true/false. #13356

Merged
merged 2 commits into from
Apr 18, 2016

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Apr 18, 2016

Fixes #12082.

@@ -692,9 +694,13 @@ Registry.prototype = {
return assign({}, fallbackKnown, localKnown, resolverKnown);
},

validateFullName(fullName) {
validateFullName(fullName, tolerant) {
Copy link
Member

Choose a reason for hiding this comment

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

How about this alternative:

  • Create a new method isValidFullName that returns a boolean and never throws.
  • validateFullName could internally call isValidFullName, as could has.
  • validateFullName could continue to throw.

I think this works because validateFullName sounds imperative and I would expect it to throw, plus the tolerant param seems a bit iffy.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 will update

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, just updated. Thanks again, this is a much better pattern.

@dgeb dgeb merged commit 97a2d96 into emberjs:master Apr 18, 2016
@dgeb
Copy link
Member

dgeb commented Apr 18, 2016

Looks a lot better to me. Thanks @rwjblue 👍

@rwjblue rwjblue deleted the beef-up-regexp branch July 5, 2016 20:20
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