Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($location): don't break on numeric path arguments #7161

Closed

Conversation

pkozlowski-opensource
Copy link
Member

Fixes #7054

Not sure if we want to include this in the core but I can see that it can be convenient in some cases. And well, since it is 5 minutes fix I don't care this way or another so will let others weight on this one.

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7161)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@IgorMinar
Copy link
Contributor

Instead of checking if the arg is a string just call toString on the arg all the time.

@pkozlowski-opensource
Copy link
Member Author

@IgorMinar I guess I was concerned with null / undefined arguments but yeh, I guess it is better to fail fast here instead of trying to navigate to something like '/null'. Will amend the commit.

@IgorMinar
Copy link
Contributor

If you use toString(arg) then that will deal with null and undefined.
On Sep 4, 2014 1:21 PM, "Pawel Kozlowski" [email protected] wrote:

@IgorMinar https://github.com/IgorMinar I guess I was concerned with
null / undefined arguments but yeh, I guess it is better to fail fast here
instead of trying to navigate to something like '/null'. Will amend the
commit.


Reply to this email directly or view it on GitHub
#7161 (comment).

@jeffbcross
Copy link
Contributor

@pkozlowski don't worry about amending; I have some other changes locally to add more tests and support for search and hash setters. I will swap out to string.

@jeffbcross
Copy link
Contributor

Closed via adb5c6d thanks!

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

Successfully merging this pull request may close these issues.

Error in $location.path(path) with integer argument
6 participants