modules: fix sync hook short-circuit in require() in imported CJS#62920
Open
joyeecheung wants to merge 1 commit intonodejs:mainfrom
Open
modules: fix sync hook short-circuit in require() in imported CJS#62920joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung wants to merge 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
- For imported CJS, if it's not customized by asynchronous hooks, make sure it won't use the quirky re-invented require in all cases. - When the imported CJS module is customized by synchronous hooks, in the synthetic module evalutation step, avoid calling the respective default step again. - Make the branching of loadCJSModuleWithModuleLoad() and loadCJSModuleWithSpecialRequire() more explicit, and fold the tentative fs read in the 'commonjs' translator into the share createCJSModuleWrap() helper instead of checking it twice in the same path.
Member
Author
|
cc @mcollina as #55808 (comment) referenced https://github.com/platformatic/vfs |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62920 +/- ##
==========================================
- Coverage 91.43% 89.62% -1.82%
==========================================
Files 356 706 +350
Lines 150580 219321 +68741
Branches 23602 42016 +18414
==========================================
+ Hits 137686 196568 +58882
- Misses 12625 14660 +2035
- Partials 269 8093 +7824
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: #55808 (comment)