GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • doc/api
    • repl.md
  • lib
    • repl.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/repl.md‎

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 numberDiff line numberDiff line change
@@ -597,8 +597,9 @@ changes:
597597
`SIGINT` is received, such as when `Ctrl+C` is pressed. This cannot be used
598598
together with a custom `eval` function. **Default:** `false`.
599599
* `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.
602603
* Returns: {repl.REPLServer}
603604

604605
The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance.
Collapse file

‎lib/repl.js‎

Copy file name to clipboardExpand all lines: lib/repl.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ function REPLServer(prompt,
213213
}
214214
}
215215

216+
// TODO(devsnek): Add a test case for custom eval functions.
216217
const preview = options.terminal &&
217-
(options.preview !== undefined ? !!options.preview : true);
218+
(options.preview !== undefined ? !!options.preview : !eval_);
218219

219220
this.inputStream = options.input;
220221
this.outputStream = options.output;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.