-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module: pass full URL to loader for top-level load #29736
Conversation
Landed in c42ab99 |
PR-URL: #29736 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
@Trott, why wasn't this merged instead of being committed directly? |
See number 5 at https://github.com/nodejs/node/blob/f663b31cc2aecd585e73430504f3d7f5252851ca/COLLABORATOR_GUIDE.md#landing-pull-requests. Adding metadata to commit messages (and often editing the message beyond that) means we end up with a process where this happens. In theory, I could force-push to the contributor's branch to get a purple merge (and I can still do that, I suppose), but I'm usually hesitant to force-push to someone else's branch just for those aesthetics. (Long-term, I hope we can get a commit-queue going that takes care of all this stuff automatically.) |
PR-URL: #29736 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
This passes the full URL for the top-level "runMain" to the ESM loader, instead of the pathname. In addition the existing example loader check of the input path type is adjusted to catch the original issue.
This resolves the issue raised in #29610, where the result of
new URL('/C:\path')
will throw.It's more of a footgun than an actual bug, since the issue is that the expectation is that the parent URL would be passed (
new URL('/C:\path', pathToFileURL(process.cwd() + path.sep))
works fine), but it seems better to be consistent in the use of file URLs input into the loader.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes