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

Reset params object with each attempted route match. #56

Closed
wants to merge 2 commits into from

Conversation

tkw722
Copy link

@tkw722 tkw722 commented Mar 11, 2013

I first came across this by iterating through my definitions list using a while(i--). The params object ends up accumulating params from every possible route match that didn't match the final route. This leads to unexpected results. I've updated them the for loop to simply reset the params object at the beginning of each pass to ensure it's clean for the next pass.

… Otherwise params accumulate with each attempted match.
…es in the potentially matched route of the same string as the value of a variable were being replaced since a regex based string replace method was being used. Refactored to actually replace the correct index of the compared route followed by rejoining it into its string form for comparison. This ensures no collisions between variable values and similar substrings in the route.
@tkw722
Copy link
Author

tkw722 commented Mar 19, 2013

I need to recreate this pull request from a dedicated branch to separate the two commits. (Rookie)

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.

1 participant