Skip to content

repl: add ImportExpression to disallow list of speculative evaluation#64534

Open
BlankParticle wants to merge 1 commit into
nodejs:mainfrom
BlankParticle:fix/repl-disable-speculative-eval-for-imports
Open

repl: add ImportExpression to disallow list of speculative evaluation#64534
BlankParticle wants to merge 1 commit into
nodejs:mainfrom
BlankParticle:fix/repl-disable-speculative-eval-for-imports

Conversation

@BlankParticle

Copy link
Copy Markdown

Fixes: #64523

REPL speculative completeions were allowing ImportExpression to be
egarly evaluated, which caused the REPL to try importing invalid modules
which would cause the REPL to get stuck in a loop of trying to import
the module and failing causing it to lock up. This commit makes it so
that ImportExpression are disallowed from being evaluated in that case.

REPL speculative completeions were allowing ImportExpression to be
egarly evaluated, which caused the REPL to try importing invalid modules
which would cause the REPL to get stuck in a loop of trying to import
the module and failing causing it to lock up. This commit makes it so
that ImportExpression are disallowed from being evaluated in that case.

Fixes: nodejs#64523
Signed-off-by: BlankParticle <blankparticle@gmail.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.24%. Comparing base (cf882a7) to head (38f894c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64534      +/-   ##
==========================================
- Coverage   90.24%   90.24%   -0.01%     
==========================================
  Files         739      739              
  Lines      241667   241668       +1     
  Branches    45550    45543       -7     
==========================================
- Hits       218093   218090       -3     
- Misses      15109    15112       +3     
- Partials     8465     8466       +1     
Files with missing lines Coverage Δ
lib/internal/repl/completion.js 95.13% <100.00%> (+<0.01%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

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.

Typing import(""). locks up node repl and gets caught in a error loop

2 participants