Polish @babel/node REPL (#12786)

This commit is contained in:
Huáng Jùnliàng 2021-02-10 18:34:29 -05:00 committed by GitHub
parent c07185207c
commit 4b8a6a8e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,13 +213,19 @@ function requireArgs() {
}
function replStart() {
repl.start({
const replServer = repl.start({
prompt: "babel > ",
input: process.stdin,
output: process.stdout,
eval: replEval,
useGlobal: true,
preview: true,
});
if (process.env.BABEL_8_BREAKING) {
replServer.setupHistory(process.env.NODE_REPL_HISTORY, () => {});
} else {
replServer.setupHistory?.(process.env.NODE_REPL_HISTORY, () => {});
}
}
function replEval(code, context, filename, callback) {