Files
codebase-memory-mcp/tests
Martin Vogel 34c64bf8a1 feat(extract): record JS/TS receiver binding facts for imports and AMD
The same-module guard for #1128 needs to know, from the caller's own
source, whether a member call's receiver is bound to another module.
Two facts were missing:

- A JS/TS import statement that binds no local name (side-effect
  `import './x'`, a re-export, a bare or destructured `require('x')`,
  `require('x').y`) still records the path's last segment as its
  local_name, so `require('node:stream').Readable` made every `stream`
  parameter look import-bound. CBMImport.local_name_synthesized marks
  those stand-ins. A lazy `x = require('x')` and
  `const x = require('x').member` do bind that very name and stay
  unmarked. local_name itself is unchanged, so IMPORTS edges and the
  import map are untouched.
- AMD `define([...], function (dep) {...})` / `require([...], fn)` bind
  each factory parameter to the dependency at the same position. That
  binding is local to the factory and is not an import (no IMPORTS
  edge), so the unified walk carries it like the Python parameter
  bindings: the loader call notes its factory, the factory's frame binds
  the dependency parameters, the frame's pop unwinds them. The
  CommonJS-wrapper pseudo dependencies (`exports`, `module`, `require`)
  stay unbound. O(1) per node, no ancestor walk. The JS member-call
  branch reads it into CBMCall.receiver_is_amd_dependency.

Nothing reads either fact yet; the graph is unchanged by this commit.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-10 20:01:40 +01:00
..
2026-10-16 18:16:50 +02:00
2026-10-11 16:57:48 +02:00