bootstrap: use file URL instead of relative url

PR-URL: https://github.com/nodejs/node/pull/35622
Fixes: https://github.com/nodejs/node/issues/35621
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
Daijiro Wachi
2020-10-13 15:52:46 +09:00
committed by Node.js GitHub Bot
parent 9f2e19fa30
commit 8a12e9994f

View File

@@ -362,7 +362,7 @@ function initializePolicy() {
// no bare specifiers for now
let manifestURL;
if (require('path').isAbsolute(experimentalPolicy)) {
manifestURL = new URL(experimentalPolicy, 'file://');
manifestURL = new URL(`file://${experimentalPolicy}`);
} else {
const cwdURL = pathToFileURL(process.cwd());
cwdURL.pathname += '/';