Skip to content

repl: avoid deprecated require.extensions in tab completion#58653

Merged
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
gulbaki:repl-no-require-extensions
Jun 23, 2025
Merged

repl: avoid deprecated require.extensions in tab completion#58653
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
gulbaki:repl-no-require-extensions

Conversation

@gulbaki

@gulbaki gulbaki commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

This PR replaces the usage of require.extensions in the REPL autocompletion logic with Module._extensions.

require.extensions has been runtime-deprecated under DEP0039, and its usage triggers a warning in recent Node.js versions. Since require.extensions is just a user-land alias for Module._extensions, we can safely access the same object via Module._extensions without any behavioral change or deprecation warning.

Changes:

  • this.context.require.extensions → Module._extensions in the REPL complete() function
  • Adds an inline comment explaining the deprecation and replacement
  • No functional behavior change

Fixes: #58641

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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repl: don't rely on require.extensions

9 participants