Skip to content

Commit

Permalink
lib: use internal pathToFileURL
Browse files Browse the repository at this point in the history
PR-URL: nodejs#49553
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
  • Loading branch information
LiviaMedeiros authored and alexfernandez committed Nov 1, 2023
1 parent 6b0c5c6 commit d457661
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/internal/process/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function evalModule(source, print) {
function evalScript(name, body, breakFirstLine, print, shouldLoadESM = false) {
const CJSModule = require('internal/modules/cjs/loader').Module;
const { kVmBreakFirstLineSymbol } = require('internal/util');
const { pathToFileURL } = require('url');
const { pathToFileURL } = require('internal/url');

const cwd = tryGetCwd();
const origModule = globalThis.module; // Set e.g. when called from the REPL.
Expand Down
4 changes: 2 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ function REPLServer(prompt,
if (e.name === 'SyntaxError') {
let parentURL;
try {
const { pathToFileURL } = require('url');
const { pathToFileURL } = require('internal/url');
// Adding `/repl` prevents dynamic imports from loading relative
// to the parent of `process.cwd()`.
parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href;
Expand Down Expand Up @@ -508,7 +508,7 @@ function REPLServer(prompt,
if (err === null) {
let parentURL;
try {
const { pathToFileURL } = require('url');
const { pathToFileURL } = require('internal/url');
// Adding `/repl` prevents dynamic imports from loading relative
// to the parent of `process.cwd()`.
parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href;
Expand Down

0 comments on commit d457661

Please sign in to comment.