-
-
Notifications
You must be signed in to change notification settings - Fork 34k
module: preserve URL in the parent created by createRequire() #60974
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
base: main
Are you sure you want to change the base?
Conversation
Previously, createRequire() does not preserve the URL it gets passed in the mock parent module created, which can be observable if it's used together with module.registerHooks(). This patch adds preservation of the URL if createRequire() is invoked with one.
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60974 +/- ##
==========================================
- Coverage 88.51% 88.51% -0.01%
==========================================
Files 703 703
Lines 208394 208438 +44
Branches 40193 40206 +13
==========================================
+ Hits 184470 184505 +35
- Misses 15934 15940 +6
- Partials 7990 7993 +3
🚀 New features to boost your workflow:
|
|
Thank you for your quick fix! I was wondering if this PR can be backported to v22 or v24? |
|
It should be back portable after staying in 25 for a few weeks (per LTS policy), the code touched is not the in usual volatile parts of the module loader but in the implementation of createRequire() which is fairly stable so there should be little conflicts. |
Previously, createRequire() does not preserve the URL it gets passed in the mock parent module created, which can be observable if it's used together with module.registerHooks(). This patch adds preservation of the URL if createRequire() is invoked with one.
Fixes: #60973