From 587d3ae34357384688b680728646dc7abadecf46 Mon Sep 17 00:00:00 2001 From: guybedford Date: Wed, 13 Sep 2017 13:33:07 +0200 Subject: [PATCH] module: check file url passed to top-level import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/nodejs/node/issues/15374 PR-URL: https://github.com/nodejs/node/pull/15389 Reviewed-By: Bradley Farias Reviewed-By: James M Snell Reviewed-By: Bartosz Sosnowski Reviewed-By: Refael Ackermann Reviewed-By: Michaƫl Zasso --- lib/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/module.js b/lib/module.js index 0b87cf7480..96f36c815a 100644 --- a/lib/module.js +++ b/lib/module.js @@ -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); });