Skip to content

Commit dad0908

Browse files
committed
lib: use internal/url module instead of url
1 parent afea87e commit dad0908

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

lib/internal/bootstrap/switches/is_main_thread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ rawMethods.resetStdioForTesting = function() {
290290
// Needed by the module loader and generally needed everywhere.
291291
require('fs');
292292
require('util');
293-
require('url');
293+
require('internal/url');
294294

295295
require('internal/modules/cjs/loader');
296296
require('internal/modules/esm/utils');

lib/internal/debugger/inspect_client.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const crypto = require('crypto');
1515
const { ERR_DEBUGGER_ERROR } = require('internal/errors').codes;
1616
const { EventEmitter } = require('events');
1717
const http = require('http');
18-
const URL = require('url');
18+
const { URL } = require('internal/url');
1919

2020
const debuglog = require('internal/util/debuglog').debuglog('inspect');
2121

@@ -297,7 +297,8 @@ class Client extends EventEmitter {
297297

298298
async _discoverWebsocketPath() {
299299
const { 0: { webSocketDebuggerUrl } } = await this._fetchJSON('/json');
300-
return URL.parse(webSocketDebuggerUrl).path;
300+
const { pathname, search } = new URL(webSocketDebuggerUrl);
301+
return `${pathname}${search}`;
301302
}
302303

303304
_connectWebsocket(urlPath) {

test/parallel/test-bootstrap-modules.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,7 @@ const expectedModules = new Set([
9595
'NativeModule internal/process/pre_execution',
9696
]);
9797

98-
if (common.isMainThread) {
99-
[
100-
'NativeModule internal/idna',
101-
'NativeModule url',
102-
].forEach(expectedModules.add.bind(expectedModules));
103-
} else {
98+
if (!common.isMainThread) {
10499
[
105100
'NativeModule diagnostics_channel',
106101
'NativeModule internal/abort_controller',

0 commit comments

Comments
 (0)