From c0e034c1a42136e97cd6749c4fd72decb1d473bf Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 19 May 2020 02:33:55 +0200 Subject: [PATCH] repl: always check for NODE_REPL_MODE environment variable This makes sure all REPL instances check for the NODE_REPL_MODE environment variable in case the `replMode` is not passed through as option. At the same time this simplifies the internal REPL code significantly. Signed-off-by: Ruben Bridgewater --- doc/api/repl.md | 4 ++ lib/internal/main/repl.js | 16 +------ lib/internal/repl.js | 42 ++++++------------- lib/repl.js | 11 +++-- test/parallel/test-repl-colors.js | 1 + test/parallel/test-repl-envvars.js | 30 +++++++------ test/parallel/test-repl-history-navigation.js | 13 +++--- test/parallel/test-repl-history-perm.js | 11 +++-- test/parallel/test-repl-options.js | 1 + test/parallel/test-repl-persistent-history.js | 14 +++---- test/parallel/test-repl-reverse-search.js | 14 +++---- test/parallel/test-repl-use-global.js | 25 ++++------- 12 files changed, 73 insertions(+), 109 deletions(-) diff --git a/doc/api/repl.md b/doc/api/repl.md index 75406d8afd4799..de945ef5dede9d 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -555,6 +555,10 @@ A list of the names of all Node.js modules, e.g., `'http'`.