From 98f08c06e4d3cca8c4fc42e7d3e77b063f324417 Mon Sep 17 00:00:00 2001 From: raisinten Date: Thu, 14 Jan 2021 19:22:52 +0530 Subject: [PATCH] test,benchmark: stop requiring URL and URLSearchParams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the URL and URLSearchParams classes are available in the global object, there is no need to require them from 'url'. PR-URL: https://github.com/nodejs/node/pull/36927 Reviewed-By: James M Snell Reviewed-By: Michaël Zasso --- benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js | 1 - benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js | 1 - benchmark/url/url-searchparams-iteration.js | 1 - benchmark/url/url-searchparams-read.js | 1 - benchmark/url/url-searchparams-sort.js | 1 - test/es-module/test-esm-dynamic-import.js | 1 - test/es-module/test-esm-loader-modulemap.js | 1 - test/parallel/test-fs-exists.js | 1 - test/parallel/test-fs-null-bytes.js | 1 - test/parallel/test-fs-whatwg-url.js | 1 - test/parallel/test-http-client-get-url.js | 1 - test/parallel/test-http2-altsvc.js | 1 - test/parallel/test-http2-connect-method.js | 1 - test/parallel/test-http2-create-client-connect.js | 1 - test/parallel/test-http2-response-splitting.js | 1 - test/parallel/test-https-client-get-url.js | 2 -- test/parallel/test-url-format-whatwg.js | 1 - test/parallel/test-vm-module-link.js | 1 - test/parallel/test-whatwg-url-constructor.js | 1 - test/parallel/test-whatwg-url-custom-global.js | 1 - test/parallel/test-whatwg-url-custom-inspect.js | 1 - test/parallel/test-whatwg-url-custom-parsing.js | 1 - test/parallel/test-whatwg-url-custom-properties.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-append.js | 1 - .../parallel/test-whatwg-url-custom-searchparams-constructor.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-delete.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-entries.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-foreach.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-get.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-getall.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-has.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-inspect.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-keys.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-set.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-sort.js | 1 - .../parallel/test-whatwg-url-custom-searchparams-stringifier.js | 1 - test/parallel/test-whatwg-url-custom-searchparams-values.js | 1 - test/parallel/test-whatwg-url-custom-searchparams.js | 1 - test/parallel/test-whatwg-url-custom-setters.js | 1 - test/parallel/test-whatwg-url-custom-tostringtag.js | 1 - test/parallel/test-whatwg-url-origin.js | 1 - test/parallel/test-whatwg-url-setters.js | 1 - test/parallel/test-whatwg-url-toascii.js | 1 - test/sequential/test-inspector-port-zero.js | 1 - 44 files changed, 45 deletions(-) diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js index f6037d332d0692..fc21ea7c85d14b 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common.js'); -const { URLSearchParams } = require('url'); const querystring = require('querystring'); const searchParams = common.searchParams; diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js index cb2301e94036da..b9c2861719bc0f 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common.js'); -const { URLSearchParams } = require('url'); const querystring = require('querystring'); const searchParams = common.searchParams; diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js index b628908d62c708..ce530c5227fab3 100644 --- a/benchmark/url/url-searchparams-iteration.js +++ b/benchmark/url/url-searchparams-iteration.js @@ -1,7 +1,6 @@ 'use strict'; const common = require('../common.js'); const assert = require('assert'); -const { URLSearchParams } = require('url'); const bench = common.createBenchmark(main, { loopMethod: ['forEach', 'iterator'], diff --git a/benchmark/url/url-searchparams-read.js b/benchmark/url/url-searchparams-read.js index cdaaa7ad11a8c3..e1cb39fbe71cd8 100644 --- a/benchmark/url/url-searchparams-read.js +++ b/benchmark/url/url-searchparams-read.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common.js'); -const { URLSearchParams } = require('url'); const bench = common.createBenchmark(main, { accessMethod: ['get', 'getAll', 'has'], diff --git a/benchmark/url/url-searchparams-sort.js b/benchmark/url/url-searchparams-sort.js index 5beb98cf2d2e25..a1873fd612f873 100644 --- a/benchmark/url/url-searchparams-sort.js +++ b/benchmark/url/url-searchparams-sort.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common.js'); -const URLSearchParams = require('url').URLSearchParams; const inputs = { wpt: 'wpt', // To work around tests diff --git a/test/es-module/test-esm-dynamic-import.js b/test/es-module/test-esm-dynamic-import.js index 6f8757da1b914e..6e64f86423c66b 100644 --- a/test/es-module/test-esm-dynamic-import.js +++ b/test/es-module/test-esm-dynamic-import.js @@ -1,7 +1,6 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const { URL } = require('url'); const relativePath = '../fixtures/es-modules/test-esm-ok.mjs'; const absolutePath = require.resolve('../fixtures/es-modules/test-esm-ok.mjs'); diff --git a/test/es-module/test-esm-loader-modulemap.js b/test/es-module/test-esm-loader-modulemap.js index a4d56a2c2fda1c..2d74cd385be52b 100644 --- a/test/es-module/test-esm-loader-modulemap.js +++ b/test/es-module/test-esm-loader-modulemap.js @@ -7,7 +7,6 @@ require('../common'); const assert = require('assert'); -const { URL } = require('url'); const { Loader } = require('internal/modules/esm/loader'); const ModuleMap = require('internal/modules/esm/module_map'); const ModuleJob = require('internal/modules/esm/module_job'); diff --git a/test/parallel/test-fs-exists.js b/test/parallel/test-fs-exists.js index cd2d9a712f3f58..75b7adfc3ee3d0 100644 --- a/test/parallel/test-fs-exists.js +++ b/test/parallel/test-fs-exists.js @@ -23,7 +23,6 @@ const common = require('../common'); const assert = require('assert'); const fs = require('fs'); -const { URL } = require('url'); const f = __filename; assert.throws(() => fs.exists(f), { code: 'ERR_INVALID_CALLBACK' }); diff --git a/test/parallel/test-fs-null-bytes.js b/test/parallel/test-fs-null-bytes.js index beaea00969b630..d4548c02c07009 100644 --- a/test/parallel/test-fs-null-bytes.js +++ b/test/parallel/test-fs-null-bytes.js @@ -23,7 +23,6 @@ const common = require('../common'); const assert = require('assert'); const fs = require('fs'); -const URL = require('url').URL; function check(async, sync) { const argsSync = Array.prototype.slice.call(arguments, 2); diff --git a/test/parallel/test-fs-whatwg-url.js b/test/parallel/test-fs-whatwg-url.js index a506e5eb942a54..829cfa92fafebd 100644 --- a/test/parallel/test-fs-whatwg-url.js +++ b/test/parallel/test-fs-whatwg-url.js @@ -6,7 +6,6 @@ const assert = require('assert'); const path = require('path'); const fs = require('fs'); const os = require('os'); -const URL = require('url').URL; function pathToFileURL(p) { if (!path.isAbsolute(p)) diff --git a/test/parallel/test-http-client-get-url.js b/test/parallel/test-http-client-get-url.js index a72eea56538c4d..3b091a72eda493 100644 --- a/test/parallel/test-http-client-get-url.js +++ b/test/parallel/test-http-client-get-url.js @@ -24,7 +24,6 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); const url = require('url'); -const URL = url.URL; const testPath = '/foo?bar'; const server = http.createServer(common.mustCall((req, res) => { diff --git a/test/parallel/test-http2-altsvc.js b/test/parallel/test-http2-altsvc.js index 3a1a1cf62991b7..39a3ca97b78bf3 100644 --- a/test/parallel/test-http2-altsvc.js +++ b/test/parallel/test-http2-altsvc.js @@ -6,7 +6,6 @@ if (!common.hasCrypto) const assert = require('assert'); const http2 = require('http2'); -const { URL } = require('url'); const Countdown = require('../common/countdown'); const server = http2.createServer(); diff --git a/test/parallel/test-http2-connect-method.js b/test/parallel/test-http2-connect-method.js index d5b4c4bd274950..4ada9f47553528 100644 --- a/test/parallel/test-http2-connect-method.js +++ b/test/parallel/test-http2-connect-method.js @@ -6,7 +6,6 @@ if (!common.hasCrypto) const assert = require('assert'); const net = require('net'); const http2 = require('http2'); -const { URL } = require('url'); const { HTTP2_HEADER_METHOD, diff --git a/test/parallel/test-http2-create-client-connect.js b/test/parallel/test-http2-create-client-connect.js index 8a4fc9a1d0e075..5723fcecd6f069 100644 --- a/test/parallel/test-http2-create-client-connect.js +++ b/test/parallel/test-http2-create-client-connect.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) const fixtures = require('../common/fixtures'); const h2 = require('http2'); const url = require('url'); -const URL = url.URL; { const server = h2.createServer(); diff --git a/test/parallel/test-http2-response-splitting.js b/test/parallel/test-http2-response-splitting.js index 9613eca9636ae4..a94b9ca4f72b35 100644 --- a/test/parallel/test-http2-response-splitting.js +++ b/test/parallel/test-http2-response-splitting.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) common.skip('missing crypto'); const assert = require('assert'); const http2 = require('http2'); -const { URL } = require('url'); // Response splitting example, credit: Amit Klein, Safebreach const str = '/welcome?lang=bar%c4%8d%c4%8aContent­Length:%200%c4%8d%c4%8a%c' + diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js index 76328775e80187..fb91a4f1e7cb8a 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -32,8 +32,6 @@ const assert = require('assert'); const https = require('https'); const url = require('url'); -const URL = url.URL; - const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem') diff --git a/test/parallel/test-url-format-whatwg.js b/test/parallel/test-url-format-whatwg.js index ab3d18bdc3aa25..9c86a7ae2c6910 100644 --- a/test/parallel/test-url-format-whatwg.js +++ b/test/parallel/test-url-format-whatwg.js @@ -6,7 +6,6 @@ if (!common.hasIntl) const assert = require('assert'); const url = require('url'); -const URL = url.URL; const myURL = new URL('http://xn--lck1c3crb1723bpq4a.com/a?a=b#c'); diff --git a/test/parallel/test-vm-module-link.js b/test/parallel/test-vm-module-link.js index 48f06439b6dacf..99235cf1b6c033 100644 --- a/test/parallel/test-vm-module-link.js +++ b/test/parallel/test-vm-module-link.js @@ -5,7 +5,6 @@ const common = require('../common'); const assert = require('assert'); -const { URL } = require('url'); const { SourceTextModule } = require('vm'); diff --git a/test/parallel/test-whatwg-url-constructor.js b/test/parallel/test-whatwg-url-constructor.js index d5b12a6021b772..3dc1c5986027e7 100644 --- a/test/parallel/test-whatwg-url-constructor.js +++ b/test/parallel/test-whatwg-url-constructor.js @@ -6,7 +6,6 @@ if (!common.hasIntl) { } const fixtures = require('../common/fixtures'); -const { URL, URLSearchParams } = require('url'); const { test, assert_equals, assert_true, assert_throws } = require('../common/wpt').harness; diff --git a/test/parallel/test-whatwg-url-custom-global.js b/test/parallel/test-whatwg-url-custom-global.js index c79723f0490e07..b99dfd8f3e7d94 100644 --- a/test/parallel/test-whatwg-url-custom-global.js +++ b/test/parallel/test-whatwg-url-custom-global.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const { URL, URLSearchParams } = require('url'); assert.deepStrictEqual( Object.getOwnPropertyDescriptor(global, 'URL'), diff --git a/test/parallel/test-whatwg-url-custom-inspect.js b/test/parallel/test-whatwg-url-custom-inspect.js index 318b8b66d5672a..ad77f5725d30ed 100644 --- a/test/parallel/test-whatwg-url-custom-inspect.js +++ b/test/parallel/test-whatwg-url-custom-inspect.js @@ -9,7 +9,6 @@ if (!common.hasIntl) { } const util = require('util'); -const URL = require('url').URL; const assert = require('assert'); const url = new URL('https://username:password@host.name:8080/path/name/?que=ry#hash'); diff --git a/test/parallel/test-whatwg-url-custom-parsing.js b/test/parallel/test-whatwg-url-custom-parsing.js index 2799a9caef3efe..6d9a9a816eff83 100644 --- a/test/parallel/test-whatwg-url-custom-parsing.js +++ b/test/parallel/test-whatwg-url-custom-parsing.js @@ -8,7 +8,6 @@ if (!common.hasIntl) { common.skip('missing Intl'); } -const URL = require('url').URL; const assert = require('assert'); const fixtures = require('../common/fixtures'); diff --git a/test/parallel/test-whatwg-url-custom-properties.js b/test/parallel/test-whatwg-url-custom-properties.js index 23742a8e7493e2..0267c7fca41820 100644 --- a/test/parallel/test-whatwg-url-custom-properties.js +++ b/test/parallel/test-whatwg-url-custom-properties.js @@ -4,7 +4,6 @@ // Tests below are not from WPT. require('../common'); -const URL = require('url').URL; const assert = require('assert'); const urlToOptions = require('internal/url').urlToOptions; diff --git a/test/parallel/test-whatwg-url-custom-searchparams-append.js b/test/parallel/test-whatwg-url-custom-searchparams-append.js index cf93950ebd514c..5d2976a23cad53 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-append.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-append.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-constructor.js b/test/parallel/test-whatwg-url-custom-searchparams-constructor.js index ab065814179d3f..878caed43ff0ab 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-constructor.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-constructor.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; function makeIterableFunc(array) { return Object.assign(() => {}, { diff --git a/test/parallel/test-whatwg-url-custom-searchparams-delete.js b/test/parallel/test-whatwg-url-custom-searchparams-delete.js index 5c3088b0363ff1..e84f10e3f93df8 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-delete.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-delete.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const { URL, URLSearchParams } = require('url'); { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-entries.js b/test/parallel/test-whatwg-url-custom-searchparams-entries.js index b70717ff2b78c1..6e5dabb1a768c4 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-entries.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-entries.js @@ -2,7 +2,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; // Tests below are not from WPT. const params = new URLSearchParams('a=b&c=d'); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-foreach.js b/test/parallel/test-whatwg-url-custom-searchparams-foreach.js index b796cff9bc1b5c..0c035161dbea97 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-foreach.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-foreach.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const { URLSearchParams } = require('url'); { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-get.js b/test/parallel/test-whatwg-url-custom-searchparams-get.js index 1088fcc43d439a..4ce16805ceceb9 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-get.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-get.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-getall.js b/test/parallel/test-whatwg-url-custom-searchparams-getall.js index 8d229a25979d6c..d3f271fcc5dc7b 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-getall.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-getall.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-has.js b/test/parallel/test-whatwg-url-custom-searchparams-has.js index 4a76dda6d3dc48..1963e40057ef72 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-has.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-has.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-inspect.js b/test/parallel/test-whatwg-url-custom-searchparams-inspect.js index 6cc22caea62436..c03890938d9cfe 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-inspect.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-inspect.js @@ -5,7 +5,6 @@ require('../common'); const assert = require('assert'); const util = require('util'); -const URLSearchParams = require('url').URLSearchParams; const sp = new URLSearchParams('?a=a&b=b&b=c'); assert.strictEqual(util.inspect(sp), diff --git a/test/parallel/test-whatwg-url-custom-searchparams-keys.js b/test/parallel/test-whatwg-url-custom-searchparams-keys.js index 5a222c7428eac7..b65e71c9a24153 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-keys.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-keys.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; const params = new URLSearchParams('a=b&c=d'); const keys = params.keys(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-set.js b/test/parallel/test-whatwg-url-custom-searchparams-set.js index 39462bf4880065..106e94d6a249a9 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-set.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-set.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-sort.js b/test/parallel/test-whatwg-url-custom-searchparams-sort.js index 49c3b065f957c6..e0b0c5c1ed12f6 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-sort.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-sort.js @@ -3,7 +3,6 @@ // Tests below are not from WPT. require('../common'); -const { URL, URLSearchParams } = require('url'); const { test, assert_array_equals } = require('../common/wpt').harness; // TODO(joyeecheung): upstream this to WPT, if possible - even diff --git a/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js b/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js index 35307fa914975a..e46865e8b014eb 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; { const params = new URLSearchParams(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-values.js b/test/parallel/test-whatwg-url-custom-searchparams-values.js index eedad691fa351c..9c4bb05d0e587d 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-values.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-values.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URLSearchParams = require('url').URLSearchParams; const params = new URLSearchParams('a=b&c=d'); const values = params.values(); diff --git a/test/parallel/test-whatwg-url-custom-searchparams.js b/test/parallel/test-whatwg-url-custom-searchparams.js index 39c8d87b6a60bf..272435b001a366 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams.js +++ b/test/parallel/test-whatwg-url-custom-searchparams.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const { URL, URLSearchParams } = require('url'); const fixtures = require('../common/fixtures'); const serialized = 'a=a&a=1&a=true&a=undefined&a=null&a=%EF%BF%BD' + diff --git a/test/parallel/test-whatwg-url-custom-setters.js b/test/parallel/test-whatwg-url-custom-setters.js index e10ebb9fe66968..b98bf5d8d3b393 100644 --- a/test/parallel/test-whatwg-url-custom-setters.js +++ b/test/parallel/test-whatwg-url-custom-setters.js @@ -9,7 +9,6 @@ if (!common.hasIntl) { } const assert = require('assert'); -const URL = require('url').URL; const { test, assert_equals } = require('../common/wpt').harness; const fixtures = require('../common/fixtures'); diff --git a/test/parallel/test-whatwg-url-custom-tostringtag.js b/test/parallel/test-whatwg-url-custom-tostringtag.js index 784a3ebc7728e5..54e5850a8f07b9 100644 --- a/test/parallel/test-whatwg-url-custom-tostringtag.js +++ b/test/parallel/test-whatwg-url-custom-tostringtag.js @@ -4,7 +4,6 @@ require('../common'); const assert = require('assert'); -const URL = require('url').URL; const toString = Object.prototype.toString; diff --git a/test/parallel/test-whatwg-url-origin.js b/test/parallel/test-whatwg-url-origin.js index 05bd1229177e15..532ff06bb1152f 100644 --- a/test/parallel/test-whatwg-url-origin.js +++ b/test/parallel/test-whatwg-url-origin.js @@ -6,7 +6,6 @@ if (!common.hasIntl) { } const fixtures = require('../common/fixtures'); -const URL = require('url').URL; const { test, assert_equals } = require('../common/wpt').harness; const request = { diff --git a/test/parallel/test-whatwg-url-setters.js b/test/parallel/test-whatwg-url-setters.js index 6634fdd4b844e5..8742ab8ed372de 100644 --- a/test/parallel/test-whatwg-url-setters.js +++ b/test/parallel/test-whatwg-url-setters.js @@ -6,7 +6,6 @@ if (!common.hasIntl) { common.skip('missing Intl'); } -const URL = require('url').URL; const { test, assert_equals } = require('../common/wpt').harness; const fixtures = require('../common/fixtures'); diff --git a/test/parallel/test-whatwg-url-toascii.js b/test/parallel/test-whatwg-url-toascii.js index c5f0f24d6031d1..e5180bfb344127 100644 --- a/test/parallel/test-whatwg-url-toascii.js +++ b/test/parallel/test-whatwg-url-toascii.js @@ -6,7 +6,6 @@ if (!common.hasIntl) { } const fixtures = require('../common/fixtures'); -const { URL } = require('url'); const { test, assert_equals, assert_throws } = require('../common/wpt').harness; const request = { diff --git a/test/sequential/test-inspector-port-zero.js b/test/sequential/test-inspector-port-zero.js index 59027b5e30769d..1683394a1dd4a3 100644 --- a/test/sequential/test-inspector-port-zero.js +++ b/test/sequential/test-inspector-port-zero.js @@ -4,7 +4,6 @@ const { mustCall, skipIfInspectorDisabled } = require('../common'); skipIfInspectorDisabled(); const assert = require('assert'); -const { URL } = require('url'); const { spawn } = require('child_process'); function test(arg, port = '') {