Skip to content

Commit 688d01c

Browse files
cjihrigtargos
authored andcommitted
doc: add warning to readline's close() method
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]>
1 parent ca06e65 commit 688d01c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/api/readline.md

+3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ The `rl.close()` method closes the `readline.Interface` instance and
195195
relinquishes control over the `input` and `output` streams. When called,
196196
the `'close'` event will be emitted.
197197

198+
Calling `rl.close()` does not immediately stop other events (including `'line'`)
199+
from being emitted by the `readline.Interface` instance.
200+
198201
### rl.pause()
199202
<!-- YAML
200203
added: v0.3.4

0 commit comments

Comments
 (0)