-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
module: allow overriding linked requests for a ModuleWrap #59527
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
This allows overriding linked requests for a `ModuleWrap`. The `statusOverride` in `vm.SourceTextModule` could call `moduleWrap.link` a second time when `statusOverride` of `linking` is set to undefined. Overriding of linked requests should be no harm but better to be avoided. However, this will require a follow-up fix on `statusOverride` in `vm.SourceTextModule`.
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #59527 +/- ##
==========================================
+ Coverage 89.86% 89.89% +0.03%
==========================================
Files 656 656
Lines 193141 193135 -6
Branches 37893 37888 -5
==========================================
+ Hits 173561 173617 +56
+ Misses 12103 12054 -49
+ Partials 7477 7464 -13
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM though I am a bit confused by the PR description
The statusOverride in vm.SourceTextModule could call moduleWrap.link
a second time when statusOverride of linking is set to undefined.
It's a plain property AFAICT. It seems the more likely cause is that there isn't sufficient guard in the link method to prevent calling the native link method again on a module from the cache that has already called link? Though as long as instantiate() is not called, that seems fine and can be allowed.
The node/lib/internal/vm/module.js Line 329 in eaf1c15
node/lib/internal/vm/module.js Line 368 in eaf1c15
This means that the status of the |
This allows overriding linked requests for a
ModuleWrap
. ThestatusOverride
invm.SourceTextModule
could callmoduleWrap.link
a second time when
statusOverride
oflinking
is set to undefined.Overriding of linked requests should be no harm but better to be
avoided. However, this will require a follow-up fix on
statusOverride
in
vm.SourceTextModule.link
.Fixes: #59480