safer REPL

This commit is contained in:
2023-05-12 11:06:37 +02:00
parent fa3ee1fc2a
commit 28c5b31e2d

View File

@@ -398,9 +398,13 @@ function getCommand(){
if (command == "close") {
rl.close();
} else {
console.log(command, eval(command) )
getCommand()
// somehow switch to node REPL proper after?!
try {
console.log(command, eval(command) )
} catch (err) {
console.log(err)
}
getCommand()
// somehow switch to node REPL proper after?!
}
});
}