Skip to content

[TypeScript] func_start names a quoted method async "array-objects"() {} as async #3760

Closed

Description

@squid-protocol

What

// packages/bench/compile-vs-arktype.ts:414 (colinhacks/zod@2bf7b0630d53)
  async "array-objects"() {
    await metabench("array of 50 objects", { ... }).run();
  },

The engine extracts this object-literal method as a function named async. The name is a string-literal key ("array-objects"), and the modifier keyword is captured instead. Calls from its body are attributed to a unit called async (found as an unmapped caller in the new Level 2 TypeScript check, tests/tools/call_graph_resolution.py typescript, branch claude/optimistic-heisenberg-bta91d). async then also enters the repo's definition index as a callable name.

Expected

The unit is named array-objects (the string key without its quotes), or at least never a modifier keyword (async, static, get, set, *). The same check probably applies to JavaScript's func_start. Worth adding a valid-case entry to tests/extraction/languages/test_typescript.py (and test_javascript.py) per tests/extraction/how_to_harden_extraction.md.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing engine

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions