-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: add warning to readline's close() method #22679
Conversation
Node.js Collaborators, please, add 👍 here if you approve fast-tracking. |
@@ -195,6 +195,9 @@ The `rl.close()` method closes the `readline.Interface` instance and | |||
relinquishes control over the `input` and `output` streams. When called, | |||
the `'close'` event will be emitted. | |||
|
|||
Calling `rl.close()` does not immediately stop other events (including `'line'`) |
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.
Micro-nit: Is immediately
meaningful here? Would it be better without it?
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.
Instead of immediately
, might necessarily
be better?
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.
I copied the text from the pause()
docs for consistency. That said, I'm open to using any wording here if you feel strongly enough.
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.
It’s a nit. I don’t feel strongly.
When close() is called on a readline instance, it is possible that data is already buffered, and will trigger 'line' events. This commit adds a warning to the corresponding docs. Note that a similar warning already exists for the pause() method. PR-URL: nodejs#22679 Fixes: nodejs#22615 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: George Adams <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
When close() is called on a readline instance, it is possible that data is already buffered, and will trigger 'line' events. This commit adds a warning to the corresponding docs. Note that a similar warning already exists for the pause() method. PR-URL: #22679 Fixes: #22615 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: George Adams <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
When
close()
is called on areadline
instance, it is possible that data is already buffered, and will trigger'line'
events. This commit adds a warning to the corresponding docs. Note thata similar warning already exists for the
pause()
method.Fixes: #22615
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes