summaryrefslogtreecommitdiff
path: root/doc/api/url.md
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2017-06-26 11:59:20 +0800
committerTimothy Gu <timothygu99@gmail.com>2017-07-30 19:12:07 +0800
commitf0be75def1cc3792c91a3f0450754aa69f9da64b (patch)
tree022c38131cfcc4264ac4f18e033be988fea23678 /doc/api/url.md
parentd074b2f427165024984c81fb12166696362b0b86 (diff)
downloadandroid-node-v8-f0be75def1cc3792c91a3f0450754aa69f9da64b.tar.gz
android-node-v8-f0be75def1cc3792c91a3f0450754aa69f9da64b.tar.bz2
android-node-v8-f0be75def1cc3792c91a3f0450754aa69f9da64b.zip
doc: various small revisions in url
PR-URL: https://github.com/nodejs/node/pull/14478 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'doc/api/url.md')
-rw-r--r--doc/api/url.md20
1 files changed, 15 insertions, 5 deletions
diff --git a/doc/api/url.md b/doc/api/url.md
index a4fe496ba0..adfe82aed7 100644
--- a/doc/api/url.md
+++ b/doc/api/url.md
@@ -77,11 +77,18 @@ const myURL =
added: v7.0.0
-->
-*Note*: Using the `delete` keyword on `URL` objects (e.g.
-`delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will
-still return `true`.
-
### Class: URL
+
+Browser-compatible `URL` class, implemented by following the WHATWG URL
+Standard. [Examples of parsed URLs][] may be found in the Standard itself.
+
+*Note*: In accordance with browser conventions, all properties of `URL` objects
+are implemented as getters and setters on the class prototype, rather than as
+data properties on the object itself. Thus, unlike [legacy urlObject][]s, using
+the `delete` keyword on any properties of `URL` objects (e.g. `delete
+myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still
+return `true`.
+
#### Constructor: new URL(input[, base])
* `input` {string} The input URL to parse
@@ -116,7 +123,8 @@ const myURL = new URL('https://你好你好');
// https://xn--6qqa088eba/
```
-Additional [examples of parsed URLs][] may be found in the WHATWG URL Standard.
+*Note*: This feature is only available if the `node` executable was compiled
+with [ICU][] enabled. If not, the domain names are passed through unchanged.
#### url.hash
@@ -1142,9 +1150,11 @@ console.log(myURL.origin);
[`url.toString()`]: #url_url_tostring
[`urlSearchParams.entries()`]: #url_urlsearchparams_entries
[`urlSearchParams@@iterator()`]: #url_urlsearchparams_iterator
+[ICU]: intl.html#intl_options_for_building_node_js
[Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4
[WHATWG URL Standard]: https://url.spec.whatwg.org/
[WHATWG URL]: #url_the_whatwg_url_api
[examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing
+[legacy urlObject]: #url_legacy_urlobject
[percent-encoded]: #whatwg-percent-encoding
[stable sorting algorithm]: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability