X Tutup
The Wayback Machine - https://web.archive.org/web/20220321174231/https://github.com/nodejs/node/commit/986dbb3222
Skip to content
Permalink
Browse files
doc: clarify treatment of non-string argument to new URL()
Closes: #41653

PR-URL: #41658
Fixes: #41653
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
Trott authored and ruyadorno committed Feb 7, 2022
1 parent 30df37f commit 986dbb3222df0ae96f231db0a29d12b76b07f1f4
Showing with 2 additions and 1 deletion.
  1. +2 −1 doc/api/url.md
@@ -131,7 +131,7 @@ return `true`.

* `input` {string} The absolute or relative input URL to parse. If `input`
is relative, then `base` is required. If `input` is absolute, the `base`
is ignored.
is ignored. If `input` is not a string, it is [converted to a string][] first.
* `base` {string|URL} The base URL to resolve against if the `input` is not
absolute.

@@ -1701,6 +1701,7 @@ console.log(myURL.origin);
[`url.toString()`]: #urltostring
[`urlSearchParams.entries()`]: #urlsearchparamsentries
[`urlSearchParams@@iterator()`]: #urlsearchparamssymboliterator
[converted to a string]: https://tc39.es/ecma262/#sec-tostring
[examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing
[host name spoofing]: https://hackerone.com/reports/678487
[legacy `urlObject`]: #legacy-urlobject

0 comments on commit 986dbb3

Please sign in to comment.
X Tutup