diff options
author | Xuguang Mei <meixg@foxmail.com> | 2022-04-08 13:17:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 13:17:03 +0300 |
commit | d36b60e69a00b60b8f2c260b8c376c9a16a152df (patch) | |
tree | 6a55cf5d3967bd2290d81f949ee5e3348e9977ae /doc/api/readline.md | |
parent | 0bac5478eb9d242719f7e19f44db03d36c3647d8 (diff) |
readline: fix question still called after closed
resolve: https://github.com/nodejs/node/issues/42450
PR-URL: https://github.com/nodejs/node/pull/42464
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'doc/api/readline.md')
-rw-r--r-- | doc/api/readline.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md index 58a67256104..d3a01755fa0 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -330,6 +330,8 @@ The `callback` function passed to `rl.question()` does not follow the typical pattern of accepting an `Error` object or `null` as the first argument. The `callback` is called with the provided answer as the only argument. +An error will be thrown if calling `rl.question()` after `rl.close()`. + Example usage: ```js @@ -586,6 +588,8 @@ paused. If the `readlinePromises.Interface` was created with `output` set to `null` or `undefined` the `query` is not written. +If the question is called after `rl.close()`, it returns a rejected promise. + Example usage: ```mjs @@ -855,6 +859,8 @@ The `callback` function passed to `rl.question()` does not follow the typical pattern of accepting an `Error` object or `null` as the first argument. The `callback` is called with the provided answer as the only argument. +An error will be thrown if calling `rl.question()` after `rl.close()`. + Example usage: ```js |