Skip to content

fix(javascript): respect lexical shadowing of require - #509

Merged
morluto merged 1 commit into
morluto:mainfrom
rudycelekli:fix/shadowed-require-provenance-20261004
Oct 5, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
rudycelekli:fix/shadowed-require-provenance-20261004

Conversation

@rudycelekli

Copy link
Copy Markdown

Change

Collect module links after definitions, and honor lexical require shadowing during both origin-evaluation paths. Remove premature require directOrigins; retain static import origins and destructuring/alias/assignment evaluation. Controls cover function parameters, later hoisted declarations, later block const and imported loaders. Native inert-source analyzer; no JavaScript execution or provider claim.

Reproduction and verification

29 tests PASS; before4FAIL5PASS

  • npm run check:pr: passed (Test Files 352 passed (352); Tests 1803 passed | 2 skipped (1805)).
  • npm run check:ci: passed.
  • npm run verify:package: passed installed-tarball CLI/MCP verification, including optional-dependency degradation.
  • npm pack --dry-run: passed.
  • Exact lockfile installation on Node 24.18.0 and npm 11.16.0.

These tests exercise the production seams described above. No real Hopper, Ghidra, desktop browser or Linux sandbox end-to-end verification is claimed.

Prepared with AI assistance; the reproductions and verification commands above were executed locally.

@morluto

morluto commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli! The two-pass link plus shadowing check in both origin paths is a solid fix for hoisted/lexical require shadowing.

@morluto
morluto merged commit 6a431d8 into morluto:main Oct 5, 2026
4 checks passed
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants