Skip to content

Commit e515046

Browse files
LiviaMedeirosruyadorno
authored andcommitted
lib: use internal pathToFileURL
PR-URL: #49553 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
1 parent 91af0a9 commit e515046

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/internal/process/execution.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function evalModule(source, print) {
5454
function evalScript(name, body, breakFirstLine, print, shouldLoadESM = false) {
5555
const CJSModule = require('internal/modules/cjs/loader').Module;
5656
const { kVmBreakFirstLineSymbol } = require('internal/util');
57-
const { pathToFileURL } = require('url');
57+
const { pathToFileURL } = require('internal/url');
5858

5959
const cwd = tryGetCwd();
6060
const origModule = globalThis.module; // Set e.g. when called from the REPL.

lib/repl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ function REPLServer(prompt,
467467
if (e.name === 'SyntaxError') {
468468
let parentURL;
469469
try {
470-
const { pathToFileURL } = require('url');
470+
const { pathToFileURL } = require('internal/url');
471471
// Adding `/repl` prevents dynamic imports from loading relative
472472
// to the parent of `process.cwd()`.
473473
parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href;
@@ -508,7 +508,7 @@ function REPLServer(prompt,
508508
if (err === null) {
509509
let parentURL;
510510
try {
511-
const { pathToFileURL } = require('url');
511+
const { pathToFileURL } = require('internal/url');
512512
// Adding `/repl` prevents dynamic imports from loading relative
513513
// to the parent of `process.cwd()`.
514514
parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href;

0 commit comments

Comments
 (0)