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
guybedford 2017-09-13 13:33:07 +02:00 committed by James M Snell
parent a5916107dd
commit dce72c2335
1 changed files with 1 additions and 1 deletions

View File

@ -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);
});