FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: fix type error for _refreshLine by JacksonTian · Pull Request #52133 · nodejs/node · GitHub

/ node Public

lib: fix type error for _refreshLine - #52133

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
JacksonTian:readline
Mar 21, 2024
Merged

lib: fix type error for _refreshLine#52133
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
JacksonTian:readline

Conversation

JacksonTian commented Mar 18, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

When press tab, but don't hit any completions, the interface throws type error.

node:internal/readline/interface:687
      this._refreshLine();
           ^

TypeError: this._refreshLine is not a function
    at [_tabCompleter] (node:internal/readline/interface:687:12)
    at [_tabComplete] (node:internal/readline/interface:660:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.11.1

The reproduce steps:

  1. The code:
import readline from "readline/promises";

const completions = '.set_a .set_b .help'.split(' ');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    completer: (line) => {
        const hits = completions.filter((c) => c.startsWith(line));
        // Show all completions if none found
        return [hits.length ? hits : completions, line];
    }
});

const answer = await rl.question('What is your query: > ');
  1. Run it with node. Type in hh, then press tab.
  2. Gets type error.

nodejs-github-bot added needs-ci PRs that need a full CI run. readline Issues and PRs related to the built-in readline module. labels Mar 18, 2024
BridgeAR added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 18, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 18, 2024

Copy link
Copy Markdown
Collaborator

debadree25 added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 19, 2024
H4ad added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 21, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 21, 2024
nodejs-github-bot merged commit 0a252c2 into nodejs:main Mar 21, 2024

Copy link
Copy Markdown
Collaborator

Landed in 0a252c2

marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #52133
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
PR-URL: #52133
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. readline Issues and PRs related to the built-in readline module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL