GeezerVison is showing github.com — repl: change preview default in case of custom eval functions · nodejs/node@b9b044b
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/repl.md +3-2Lines changed: 3 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -597,8 +597,9 @@ changes: |
597 | 597 | `SIGINT` is received, such as when `Ctrl+C` is pressed. This cannot be used |
598 | 598 | together with a custom `eval` function. **Default:** `false`. |
599 | 599 | * `preview` {boolean} Defines if the repl prints autocomplete and output |
600 | | - previews or not. **Default:** `true`. If `terminal` is falsy, then there are |
601 | | - no previews and the value of `preview` has no effect. |
| 600 | + previews or not. **Default:** `true` with the default eval function and |
| 601 | + `false` in case a custom eval function is used. If `terminal` is falsy, then |
| 602 | + there are no previews and the value of `preview` has no effect. |
602 | 603 | * Returns: {repl.REPLServer} |
603 | 604 |
|
604 | 605 | The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance. |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/repl.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -213,8 +213,9 @@ function REPLServer(prompt, |
213 | 213 | } |
214 | 214 | } |
215 | 215 |
|
| 216 | + // TODO(devsnek): Add a test case for custom eval functions. |
216 | 217 | const preview = options.terminal && |
217 | | - (options.preview !== undefined ? !!options.preview : true); |
| 218 | + (options.preview !== undefined ? !!options.preview : !eval_); |
218 | 219 |
|
219 | 220 | this.inputStream = options.input; |
220 | 221 | this.outputStream = options.output; |
|