Skip to content

Commit d97917f

Browse files
RaisinTenruyadorno
authored andcommitted
test,benchmark: stop requiring URL and URLSearchParams
Since the URL and URLSearchParams classes are available in the global object, there is no need to require them from 'url'. PR-URL: #36927 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 951a78b commit d97917f

File tree

44 files changed

+0
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+0
-45
lines changed

benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
const common = require('../common.js');
3-
const { URLSearchParams } = require('url');
43
const querystring = require('querystring');
54
const searchParams = common.searchParams;
65

benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
const common = require('../common.js');
3-
const { URLSearchParams } = require('url');
43
const querystring = require('querystring');
54
const searchParams = common.searchParams;
65

benchmark/url/url-searchparams-iteration.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22
const common = require('../common.js');
33
const assert = require('assert');
4-
const { URLSearchParams } = require('url');
54

65
const bench = common.createBenchmark(main, {
76
loopMethod: ['forEach', 'iterator'],

benchmark/url/url-searchparams-read.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
const common = require('../common.js');
3-
const { URLSearchParams } = require('url');
43

54
const bench = common.createBenchmark(main, {
65
accessMethod: ['get', 'getAll', 'has'],

benchmark/url/url-searchparams-sort.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22
const common = require('../common.js');
3-
const URLSearchParams = require('url').URLSearchParams;
43

54
const inputs = {
65
wpt: 'wpt', // To work around tests

test/es-module/test-esm-dynamic-import.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22
const common = require('../common');
33
const assert = require('assert');
4-
const { URL } = require('url');
54

65
const relativePath = '../fixtures/es-modules/test-esm-ok.mjs';
76
const absolutePath = require.resolve('../fixtures/es-modules/test-esm-ok.mjs');

test/es-module/test-esm-loader-modulemap.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
require('../common');
88

99
const assert = require('assert');
10-
const { URL } = require('url');
1110
const { Loader } = require('internal/modules/esm/loader');
1211
const ModuleMap = require('internal/modules/esm/module_map');
1312
const ModuleJob = require('internal/modules/esm/module_job');

test/parallel/test-fs-exists.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
const common = require('../common');
2424
const assert = require('assert');
2525
const fs = require('fs');
26-
const { URL } = require('url');
2726
const f = __filename;
2827

2928
assert.throws(() => fs.exists(f), { code: 'ERR_INVALID_CALLBACK' });

test/parallel/test-fs-null-bytes.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
const common = require('../common');
2424
const assert = require('assert');
2525
const fs = require('fs');
26-
const URL = require('url').URL;
2726

2827
function check(async, sync) {
2928
const argsSync = Array.prototype.slice.call(arguments, 2);

test/parallel/test-fs-whatwg-url.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const assert = require('assert');
66
const path = require('path');
77
const fs = require('fs');
88
const os = require('os');
9-
const URL = require('url').URL;
109

1110
function pathToFileURL(p) {
1211
if (!path.isAbsolute(p))

0 commit comments

Comments
 (0)