Skip to content

Commit

Permalink
doc: clarify treatment of non-string argument to new URL()
Browse files Browse the repository at this point in the history
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 Jan 25, 2022
1 parent 938ab0e commit 88a3bd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 88a3bd5

Please sign in to comment.