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

URI(undefined) now throws type error #196

Merged
merged 1 commit into from
Mar 11, 2015
Merged

URI(undefined) now throws type error #196

merged 1 commit into from
Mar 11, 2015

Conversation

joladev
Copy link
Contributor

@joladev joladev commented Mar 11, 2015

Note that this differs from URI() which still works as a shortcut for
URI(location).

Since there is no reason to explicitly call URI with undefined, it is
safe to assume that this happens because of user error. URI now
correctly throws a type error with a message explaining that undefined
is not a valid argument.

Note that this differs from URI() which still works as a shortcut for
URI(location).

Since there is no reason to explicitly call URI with undefined, it is
safe to assume that this happens because of user error. URI now
correctly throws a type error with a message explaining that undefined
is not a valid argument.
@joladev joladev mentioned this pull request Mar 11, 2015
rodneyrehm added a commit that referenced this pull request Mar 11, 2015
fixing `URI(undefined)` to throw TypeError
@rodneyrehm rodneyrehm merged commit b9b5635 into medialize:master Mar 11, 2015
@rodneyrehm
Copy link
Member

released v1.15.0, thank you for your support!

@KyleNeedham
Copy link

This breaks the ability to do URI() since it creates an instance of itself passing url, base which are both undefined.

See #205

@joladev
Copy link
Contributor Author

joladev commented Apr 1, 2015

@KyleNeedham You should probably have tested that before commenting. And read the description of the pull request. The URI() short hand exists as a test in the code base and the tests all pass.

URI(undefined) no longer works, while URI() still works fine.

@KyleNeedham
Copy link

@eakron Please read my issue. URI() does not work currently. You should probably have tested that.

@rodneyrehm
Copy link
Member

@KyleNeedham is correct, URI() breaks, while new URI() works. tests only exist for the latter.

Tracked in #205

@joladev
Copy link
Contributor Author

joladev commented Apr 1, 2015

@rodneyrehm There are no tests for URI()? I see, that's unfortunate. I just assumed that after our discussion... My bad, do you want me to make a new pull request? We should add a test and fix the bug.

@rodneyrehm
Copy link
Member

I've already added tests and fixed the issue, pushing just now…

@joladev
Copy link
Contributor Author

joladev commented Apr 1, 2015

@rodneyrehm Sweet, nice catch.

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.

None yet

3 participants