Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primordials break REPL autocomplete with useGlobal: false #30792

Closed
targos opened this issue Dec 4, 2019 · 1 comment
Closed

primordials break REPL autocomplete with useGlobal: false #30792

targos opened this issue Dec 4, 2019 · 1 comment
Labels
confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem.

Comments

@targos
Copy link
Member

targos commented Dec 4, 2019

Discovered in #30740

When the REPL is started with useGlobal: false, the autocomplete for globals doesn't include values that are present in the primordials object.
Example with Node.js 13.3.0:

image

I pressed "N", "TAB", "TAB". The output doesn't include Number.

@targos targos added confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem. labels Dec 4, 2019
@BridgeAR
Copy link
Member

BridgeAR commented Dec 4, 2019

useGlobal: false is in general tricky. There are multiple bugs involved with that.

@targos targos self-assigned this Dec 10, 2019
targos added a commit to targos/node that referenced this issue Dec 13, 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: nodejs#30792
@Trott Trott closed this as completed in 8e58c75 Dec 14, 2019
MylesBorins pushed a commit that referenced this issue Dec 17, 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

PR-URL: #30883
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
targos added a commit that referenced this issue Jan 14, 2020
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

PR-URL: #30883
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
BethGriggs pushed a commit that referenced this issue Feb 6, 2020
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

PR-URL: #30883
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
@targos targos removed their assignment Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants