Skip to content

The Node REPL can't handle declaring a variable with the name util #38139

Description

@murgatroid99
  • Version:14.15.4
  • Platform: Linux DESKTOP-OKC3QBQ 4.19.128-microsoft-standard deps: update openssl to 1.0.1j #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: REPL

What steps will reproduce the bug?

Run the node executable to open the REPL. In the REPL simply run the line const util = {}, then on the next line type the name of any existing symbol longer than 3 characters, such as process or module

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

This reproduction is consistent

What is the expected behavior?

The repl will continue to function normally.

What do you see instead?

The REPL overwrites most the typed line with the text (node:27986) TypeError: Cannot read property 'length' of undefined. Specifically, if I open the REPL and enter the input const util = {};<Enter>process, the REPL looks like this:

Welcome to Node.js v14.15.4.
Type ".help" for more information.
> const util = {};
undefined
> proc(node:28039) TypeError: Cannot read property 'length' of undefined
s(node:28039) TypeError: Cannot read property 'length' of undefined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.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