Skip to content

fix: distinguish eval arguments from grouped callees - #29

Draft
inth3shadows wants to merge 5 commits into
fix/commonjs-missing-memberfrom
fix/commonjs-eval-callee-context
Draft

inth3shadows wants to merge 5 commits into
fix/commonjs-missing-memberfrom
fix/commonjs-eval-callee-context

Conversation

@inth3shadows

@inth3shadows inth3shadows commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #28, targeting its branch so this PR contains only the remaining correction (3 files, 29 added lines).

Passing eval to a wrapper, such as wrap(eval)("ignored"), was mistaken for a grouped direct eval call. That marked a known CommonJS namespace as uncertain and allowed a missing member to resolve to an unrelated decoy method. Check the token before the enclosing parentheses while preserving real grouped direct eval, templates, and return expressions.

Validation on commit 87576a8:

  • New regressions failed before the correction, then 101 focused tests passed.
  • npm run build passed, including viewer, grammar assets and runtime checks.
  • Full normal suite: CODEGRAPH_KERNEL=0 npm test -- --maxWorkers=4 exited 0; 873 test files passed, 19 skipped; 10,666 tests passed, 2 expected failures, 448 skipped, zero unexpected failures (800.20s).
  • Final source hashes match the tested snapshot; tracked working tree is clean.

Covers both reported wrapper forms, call/member/optional-call/tag/condition prefixes, and genuine eval controls.

Independent review of this follow-up is pending. Keep draft; review and integrate this correction into #28 before considering #28 for main. No merge, deployment or upstream report is included.

…p patch

The full suite found PR29 dropped static members of exported class
expressions (colbymchenry#2499). The uncommitted fix is now covered by the source
hash manifest and the working-tree backup patch, which reconstructs all
30 pending paths from 87576a8. START_HERE notes that the harness
results predate the fix.
Every harness stage on a build of the fixed checkout matches the pre-fix
candidate run: replay, graph diffs, shadow, modes and metamorphic. The
full suite passes apart from two load-sensitive UI timing tests that
pass in isolation. The Express indexing regression remains open, and its
profiling attribution is noted.
Track binding-owned values and object properties for CommonJS exports.
Reference, callable and constructor evidence are kept separate, so exported
data never becomes a call target and assigned functions resolve to their
implementations. Import resolution carries that intent through named,
default, namespace and forwarded imports, and failed forwarded calls retry
after their sources change.

Class expressions are seeded like class declarations (static members,
prototype and the construction check). This keeps `module.exports = class
{ static f() {} }` resolvable (colbymchenry#2499).

On Express this removes 64 call edges: 52 had wrong targets and 12 pointed
at external-import variables without a proven callable body. The other four
QA corpora are unchanged. Indexing is slower on CommonJS-heavy projects
(Express about +38%) because of per-file TypeScript analysis. That cost is
documented in the handoff and still open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant