Skip to content

Commit 59f95fe

Browse files
Trottdanielleadams
authored andcommitted
doc: clarify treatment of non-string argument to new URL()
Closes: #41653 PR-URL: #41658 Fixes: #41653 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 2b87f97 commit 59f95fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/api/url.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ return `true`.
131131

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

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

0 commit comments

Comments
 (0)