-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
readline: add stricter validation for functions called after closed (second attempt) #58283
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
Merged
nodejs-github-bot
merged 1 commit into
nodejs:main
from
dario-piotrowicz:dario/2/readline-after-close-checks
May 18, 2025
Merged
readline: add stricter validation for functions called after closed (second attempt) #58283
nodejs-github-bot
merged 1 commit into
nodejs:main
from
dario-piotrowicz:dario/2/readline-after-close-checks
May 18, 2025
Conversation
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
1452b63
to
9762ece
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #58283 +/- ##
==========================================
+ Coverage 90.18% 90.19% +0.01%
==========================================
Files 631 631
Lines 186687 186700 +13
Branches 36663 36667 +4
==========================================
+ Hits 168355 168397 +42
+ Misses 11124 11106 -18
+ Partials 7208 7197 -11
🚀 New features to boost your workflow:
|
jasnell
approved these changes
May 12, 2025
@lpinca would you be able to give this PR a quick review? 🙂 🙏 |
lpinca
approved these changes
May 18, 2025
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.
RSLGTM
Landed in 39ab68b |
thanks @lpinca 🫶 |
targos
pushed a commit
that referenced
this pull request
May 31, 2025
PR-URL: #58283 Fixes: #57678 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
needs-ci
PRs that need a full CI run.
readline
Issues and PRs related to the built-in readline module.
repl
Issues and PRs related to the REPL subsystem.
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.
This PR makes it so that calling
pause()
,resume()
orwrite()
on a closed readline interface results inERR_USE_AFTER_CLOSE
errors being thrown (following the same behavior asquestion()
)Note
This PR reintroduces the changes committed in #57680 but reverted in #58024 they also include @lpinca's suggested test changes to prevent test flakiness.
The reason why this was reverted was because of REPL still calling
pause()
andresume()
even after it has been closed, which I am addressing that here (the lib repl files changes are specifically for that), just to be extra sure I am also adding the newtest/parallel/test-repl-close.js
test dedicated to making sure that closing a REPL does not result in errors (this test is not necessary since the error would be caught bytest/parallel/test-repl-import-referrer.js
anyways but I do think that it's nice to have a dedicated test just for this, if people disagree I'm happy to remove the new test file).Fixes: #57678