Skip to content

Commit

Permalink
doc: add warning to readline's close() method
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cjihrig authored and targos committed Sep 7, 2018
1 parent ca06e65 commit 688d01c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'`)
from being emitted by the `readline.Interface` instance.

### rl.pause()
<!-- YAML
added: v0.3.4
Expand Down

0 comments on commit 688d01c

Please sign in to comment.