Skip to content

Commit

Permalink
lib: use internal/url module instead of url
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Sep 10, 2023
1 parent afea87e commit dad0908
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/switches/is_main_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ rawMethods.resetStdioForTesting = function() {
// Needed by the module loader and generally needed everywhere.
require('fs');
require('util');
require('url');
require('internal/url');

require('internal/modules/cjs/loader');
require('internal/modules/esm/utils');
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/debugger/inspect_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const crypto = require('crypto');
const { ERR_DEBUGGER_ERROR } = require('internal/errors').codes;
const { EventEmitter } = require('events');
const http = require('http');
const URL = require('url');
const { URL } = require('internal/url');

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

Expand Down Expand Up @@ -297,7 +297,8 @@ class Client extends EventEmitter {

async _discoverWebsocketPath() {
const { 0: { webSocketDebuggerUrl } } = await this._fetchJSON('/json');
return URL.parse(webSocketDebuggerUrl).path;
const { pathname, search } = new URL(webSocketDebuggerUrl);
return `${pathname}${search}`;
}

_connectWebsocket(urlPath) {
Expand Down
7 changes: 1 addition & 6 deletions test/parallel/test-bootstrap-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ const expectedModules = new Set([
'NativeModule internal/process/pre_execution',
]);

if (common.isMainThread) {
[
'NativeModule internal/idna',
'NativeModule url',
].forEach(expectedModules.add.bind(expectedModules));
} else {
if (!common.isMainThread) {
[
'NativeModule diagnostics_channel',
'NativeModule internal/abort_controller',
Expand Down

0 comments on commit dad0908

Please sign in to comment.