mirror of https://github.com/nodejs/node.git
module: check file url passed to top-level import
Fixes: https://github.com/nodejs/node/issues/15374 PR-URL: https://github.com/nodejs/node/pull/15389 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>pull/15389/merge
parent
a5916107dd
commit
dce72c2335
|
@ -435,7 +435,7 @@ Module._load = function(request, parent, isMain) {
|
|||
if (experimentalModules) {
|
||||
if (filename === null || /\.mjs$/.test(filename)) {
|
||||
try {
|
||||
ESMLoader.import(request).catch((e) => {
|
||||
ESMLoader.import(getURLFromFilePath(filename).href).catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue