diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-06-26 03:17:00 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-06-26 05:18:55 +0300 |
commit | 072feec1b0c8d381d1921bd196c9bffb51366585 (patch) | |
tree | 553e030fe52be1e164cbcc94a787f5ae638624b8 /lib/internal/main | |
parent | 82f13fa803ac0b51f42118c26cc947b3101b6078 (diff) |
Revert "repl: always check for NODE_REPL_MODE environment variable"
This reverts commit b831b081c499a614c1ee3f0272c9de1783395402.
This presumably unbreaks the ASAN github action build.
Example failure:
2020-06-25T19:59:15.1448178Z === release test-repl-envvars ===
2020-06-25T19:59:15.1448872Z Path: parallel/test-repl-envvars
2020-06-25T19:59:15.1449449Z --- stderr ---
2020-06-25T19:59:15.1449835Z assert.js:103
2020-06-25T19:59:15.1450194Z throw new AssertionError(obj);
2020-06-25T19:59:15.1450524Z ^
2020-06-25T19:59:15.1450817Z
2020-06-25T19:59:15.1451431Z AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
2020-06-25T19:59:15.1452000Z + actual - expected
2020-06-25T19:59:15.1452298Z
2020-06-25T19:59:15.1452634Z {
2020-06-25T19:59:15.1452978Z terminal: true,
2020-06-25T19:59:15.1453321Z + useColors: false
2020-06-25T19:59:15.1453861Z - useColors: true
2020-06-25T19:59:15.1454225Z }
2020-06-25T19:59:15.1454841Z at /home/runner/work/node/node/test/parallel/test-repl-envvars.js:55:12
2020-06-25T19:59:15.1455246Z at internal/repl.js:33:5
PR-URL: https://github.com/nodejs/node/pull/34058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/internal/main')
-rw-r--r-- | lib/internal/main/repl.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index 55a88a2b181..693b7048a37 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -35,7 +35,21 @@ if (process.env.NODE_REPL_EXTERNAL_MODULE) { console.log(`Welcome to Node.js ${process.version}.\n` + 'Type ".help" for more information.'); - require('internal/repl').createInternalRepl(); + 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(); + }); + }); // If user passed '-e' or '--eval' along with `-i` or `--interactive`, // evaluate the code in the current context. |