summaryrefslogtreecommitdiff
path: root/lib/repl.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2020-01-08 11:54:51 +0100
committerRich Trott <rtrott@gmail.com>2020-01-10 04:35:37 -0800
commit95303629a4e25918e9ff7d9dbc95e9d69c817722 (patch)
tree588c50e1ef28ce17a6c1d70ff0c25314cc3ceb06 /lib/repl.js
parenteca22d5565ced362b35c8f053b18f3b87f591a8d (diff)
downloadnode-new-95303629a4e25918e9ff7d9dbc95e9d69c817722.tar.gz
repl: change preview default in case of custom eval functions
Custom eval functions might have a very different behavior than the current implementation and having a preview in such case might be confusing. This changes the preview default to `false` in case a custom eval function is used. It is still possible to opt into using the previews in case that's still desirable. PR-URL: https://github.com/nodejs/node/pull/31259 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/repl.js')
-rw-r--r--lib/repl.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/repl.js b/lib/repl.js
index 94457557c8..7707240d65 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -213,8 +213,9 @@ function REPLServer(prompt,
}
}
+ // TODO(devsnek): Add a test case for custom eval functions.
const preview = options.terminal &&
- (options.preview !== undefined ? !!options.preview : true);
+ (options.preview !== undefined ? !!options.preview : !eval_);
this.inputStream = options.input;
this.outputStream = options.output;