Commit Graph

3 Commits

Author SHA1 Message Date
Ruben Bridgewater
6c542d1c26
repl: improve completion
This improves the completion output by removing the nested special
handling. It never fully worked as expected and required a lot of
hacks to even keep it working halfway reliable. Our tests did not
cover syntax errors though and those can not be handled by this
implementation. Those break the layout and confuse the REPL.

Besides that the completion now also works in case the current line
has leading whitespace.

Also improve the error output in case the completion fails.

PR-URL: https://github.com/nodejs/node/pull/30907
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-15 16:24:00 +01:00
ZYSzys
2f981cdd58 test: remove util.inherits() usage
PR-URL: https://github.com/nodejs/node/pull/25245
Refs: https://github.com/nodejs/node/pull/24755
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 19:42:18 -08:00
Rich Trott
83d0404971 repl: do not swallow errors in nested REPLs
For tab completion, a REPLServer instance will sometimes create another
REPLServer instance. If a callback is sent to the `.complete()` function
and that callback throws an error, it will be swallowed by the nested
REPLs domain. Re-throw the error so that processes don't silently exit
without any indication of an error (including a status code).

Fixes: https://github.com/nodejs/node/issues/21586

PR-URL: https://github.com/nodejs/node/pull/23004
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-10-02 13:07:18 -07:00