From 688d01c7beeb28cad53e3de725fc730480866ae5 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 3 Sep 2018 17:39:09 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/22679 Fixes: https://github.com/nodejs/node/issues/22615 Reviewed-By: Vse Mozhet Byt Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: George Adams Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater --- doc/api/readline.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/readline.md b/doc/api/readline.md index 8efc3d6e41662e..ccc9ee92fe4f63 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -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()