-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
doc: clarify treatment of non-string argument to new URL() #41658
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,9 +129,9 @@ return `true`. | |
|
|
||
| #### `new URL(input[, base])` | ||
|
|
||
| * `input` {string} The absolute or relative input URL to parse. If `input` | ||
| * `input` {any} 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 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@TimothyGu @jasnell Sound OK to you? |
||
| 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 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.