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

new URL(url, null) fails with wrong error #19254

Closed
targos opened this issue Mar 9, 2018 · 0 comments
Closed

new URL(url, null) fails with wrong error #19254

targos opened this issue Mar 9, 2018 · 0 comments
Assignees
Labels
whatwg-url Issues and PRs related to the WHATWG URL implementation.

Comments

@targos
Copy link
Member

targos commented Mar 9, 2018

> new URL('test', null)
TypeError: Cannot read property 'Symbol(query)' of null
    at new URL (internal/url.js:306:15)

It should probably throw the same error as other invalid URLs: TypeError [ERR_INVALID_URL]: Invalid URL: null

@targos targos added the whatwg-url Issues and PRs related to the WHATWG URL implementation. label Mar 9, 2018
@benjamingr benjamingr self-assigned this Mar 12, 2018
benjamingr pushed a commit to benjamingr/io.js that referenced this issue Mar 13, 2018
Currently whatwg URLs fail with an incorrect error when null is
passed as the base. Adding a check before accessing a symbol
for the URL makes the URL error correctly. Add test for it.

PR-URL: nodejs#19299
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Fixes: nodejs#19254
targos pushed a commit that referenced this issue Apr 12, 2018
Currently whatwg URLs fail with an incorrect error when null is
passed as the base. Adding a check before accessing a symbol
for the URL makes the URL error correctly. Add test for it.

PR-URL: #19299
Fixes: #19254
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

No branches or pull requests

2 participants