From b831b081c499a614c1ee3f0272c9de1783395402 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 PR-URL: https://github.com/nodejs/node/pull/33461 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- 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 614c577d2cfd44..05b8851b8eff94 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'`.