Skip to content

fix(ts): extractPrototypeMethodsWalk called twice in same pipeline — emits duplicate definitions #1341

@carlos-alm

Description

@carlos-alm

Summary

In src/extractors/javascript.ts, extractPrototypeMethodsWalk appears to be called twice in the same pipeline function (around lines 349 and 358). This silently emits duplicate prototype method definitions into the symbols array.

The Rust engine (PR #1339) correctly calls the equivalent function once and avoids this. However the TS integration tests and baseline benchmarks were built against the duplicated output, making the divergence invisible in the test suite while still being a latent data-quality issue.

Impact

  • Duplicate symbol definitions in the WASM engine output for prototype-based OOP code
  • Native vs WASM parity divergence (native correctly emits one, WASM emits two)
  • Downstream consumers (codegraph query, MCP tools) may see duplicate entries

Fix

Remove or deduplicate the extra call to extractPrototypeMethodsWalk in the TypeScript extractor. Verify test baselines still pass after deduplication.

Context

Identified in Greptile review of PR #1339.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions