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

Exception when handling custom constraints #32

Closed
Daniel15 opened this issue Jul 4, 2014 · 3 comments
Closed

Exception when handling custom constraints #32

Daniel15 opened this issue Jul 4, 2014 · 3 comments
Assignees
Labels

Comments

@Daniel15
Copy link
Owner

Daniel15 commented Jul 4, 2014

Received via email:

Some of our routes use custom constraints. When these are parsed in the _parseConstraints methods in router.js, an exception occurs. The methods performs a replace action on this.route.constraints[key], but in the case I am looking at, this.route.constraints[key] is an (empty) object.

@Daniel15
Copy link
Owner Author

Daniel15 commented Jul 6, 2014

This has been fixed in the 1.1.7 release. Thanks for reporting!

@Daniel15 Daniel15 closed this as completed Jul 6, 2014
@stijnherreman
Copy link

Just ran into the issue myself. If I understand correctly, the fix is fine if the route parameters do not match the route. When the route parameters do match the route, RouteJs will generate an incorrect URL.

There's no way for RouteJs to fix this, but perhaps a console warning can be generated when a route with custom constraints is used? It would make developers aware so that they can try to work around the issue.

I could be wrong entirely though, I'll see if I can create a proof of concept where the fix causes an issue.

@Daniel15
Copy link
Owner Author

Daniel15 commented Aug 9, 2014

Yeah, please create another issue if you can make a self-contained proof of concept. I don't use custom constraints myself, and haven't really seem them very widely used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants