-
Notifications
You must be signed in to change notification settings - Fork 30k
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 <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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 <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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