Skip to content

REPL gives wrong autocomplete on literals #41690

Closed
@targos

Description

@targos

Version

16.13.2, 17.4.0

Platform

Windows

Subsystem

repl

What steps will reproduce the bug?

Try this in the repl:

$ node
Welcome to Node.js v16.13.2.
Type ".help" for more information.
> ''.at

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

Autocomplete should not suggest global variables in this case.

What do you see instead?

The command is autocompleted to ''.atob, which doesn't make any sense (I wanted to try ''.at()).

It can be reproduced with any combination of literal and existing global.
For example:

  • [].Bu autocompletes to Buffer
  • {}.Ui autocompletes to Uint

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions