diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2020-05-19 03:33:55 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-06-25 21:54:46 +0300 |
commit | b831b081c499a614c1ee3f0272c9de1783395402 (patch) | |
tree | ec329e175766d0392a7ff75ee64818dce88fd9ae /lib/internal/main | |
parent | 40bc3095ab86d5311b211c2fd08048d9704b6ab2 (diff) |
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 <ruben@bridgewater.de>
PR-URL: https://github.com/nodejs/node/pull/33461
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/internal/main')
-rw-r--r-- | lib/internal/main/repl.js | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index 693b7048a37..55a88a2b181 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -35,21 +35,7 @@ if (process.env.NODE_REPL_EXTERNAL_MODULE) { console.log(`Welcome to Node.js ${process.version}.\n` + 'Type ".help" for more information.'); - const cliRepl = require('internal/repl'); - cliRepl.createInternalRepl(process.env, (err, repl) => { - if (err) { - throw err; - } - repl.on('exit', () => { - if (repl._flushing) { - repl.pause(); - return repl.once('flushHistory', () => { - process.exit(); - }); - } - process.exit(); - }); - }); + require('internal/repl').createInternalRepl(); // If user passed '-e' or '--eval' along with `-i` or `--interactive`, // evaluate the code in the current context. |