Commit 8e58c755 authored by Michaël Zasso's avatar Michaël Zasso Committed by Rich Trott
Browse files

repl: fix autocomplete when useGlobal is false

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: https://github.com/nodejs/node/issues/30792

PR-URL: https://github.com/nodejs/node/pull/30883


Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarDavid Carlier <devnexen@gmail.com>
parent e490b2ca
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment