GeezerVison is showing github.com — doc: clarify treatment of non-string argument to new URL() · nodejs/node@59f95fe
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/url.md +2-1Lines changed: 2 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -131,7 +131,7 @@ return `true`. |
131 | 131 |
|
132 | 132 | * `input` {string} The absolute or relative input URL to parse. If `input` |
133 | 133 | 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. |
135 | 135 | * `base` {string|URL} The base URL to resolve against if the `input` is not |
136 | 136 | absolute. |
137 | 137 |
|
@@ -1684,6 +1684,7 @@ console.log(myURL.origin); |
1684 | 1684 | [`url.toString()`]: #urltostring |
1685 | 1685 | [`urlSearchParams.entries()`]: #urlsearchparamsentries |
1686 | 1686 | [`urlSearchParams@@iterator()`]: #urlsearchparamssymboliterator |
| 1687 | +[converted to a string]: https://tc39.es/ecma262/#sec-tostring |
1687 | 1688 | [examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing |
1688 | 1689 | [host name spoofing]: https://hackerone.com/reports/678487 |
1689 | 1690 | [legacy `urlObject`]: #legacy-urlobject |
|