Skip to content

repl: fix autocomplete when useGlobal is false#30883

Closed
targos wants to merge 1 commit intonodejs:masterfrom
targos:fix-use-global
Closed

repl: fix autocomplete when useGlobal is false#30883
targos wants to merge 1 commit intonodejs:masterfrom
targos:fix-use-global

Conversation

@targos
Copy link
Member

@targos targos commented Dec 10, 2019

This fixes two issues in the REPL when it is started with a new context
(useGlobal option set to false):

  • The primordials object does not contain all builtins, so the
    filtering based on property names from primordials was wrong.
  • The autocompleter did not take builtin names into account because
    they are not properties of the context object.

A list of all global builtin names is created lazily when needed. It is
used for filtering for the copy and for adding those names to the
autocompleter list.

Fixes: #30792

I did not add a new test because this will be covered when #30740 has landed.

Loading
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 pending requests for changes, and a CI started. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

primordials break REPL autocomplete with useGlobal: false

5 participants