diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-01-21 17:11:47 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-01-31 16:00:51 +0100 |
commit | 312414662b678d95bee2904348e053728993b97a (patch) | |
tree | c447bed7576b9e58a8b092b7dc988afe9a2d6015 /doc/api/esm.md | |
parent | 332b56c82b0c4e4b4608db106b1ed75532202dda (diff) | |
download | android-node-v8-312414662b678d95bee2904348e053728993b97a.tar.gz android-node-v8-312414662b678d95bee2904348e053728993b97a.tar.bz2 android-node-v8-312414662b678d95bee2904348e053728993b97a.zip |
url: expose the WHATWG URL API globally
Install URL and URLSearchParams on the global object, like they can be
found in browser environments.
PR-URL: https://github.com/nodejs/node/pull/18281
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/esm.md')
-rw-r--r-- | doc/api/esm.md | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md index 0e86c381f1..e9b38735be 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -143,7 +143,6 @@ rules with only JS file extension and Node builtin modules support could be written: ```js -import url from 'url'; import path from 'path'; import process from 'process'; import Module from 'module'; @@ -164,7 +163,7 @@ export function resolve(specifier, parentModuleURL/*, defaultResolve */) { throw new Error( `imports must begin with '/', './', or '../'; '${specifier}' does not`); } - const resolved = new url.URL(specifier, parentModuleURL); + const resolved = new URL(specifier, parentModuleURL); const ext = path.extname(resolved.pathname); if (!JS_EXTENSIONS.has(ext)) { throw new Error( |