Skip to content

[TypeScript] Arrow-function regex rejects bodies starting with exclamation mark (!) #2231

Closed

Description

@squid-protocol

Problem:
GitGalaxy fails to extract predicate in playwright/frames.ts.

Root Cause:
The arrow function is defined as const predicate = (e: NavigationEvent) => !e.newDocument;. The body-start lookahead for arrow functions in language_standards.py's func_start is restricted to (?:[{<]|\(|$|[a-zA-Z_$][\w$]*(?=[ \t\n]*\()|(?!(?:void|string...)\b)[a-z_][\w$]*). Because the body starts with !, which is absent from this whitelist, it is rejected.

To Reproduce:
Run tests/tools/tree_sitter_accuracy_audit.py --lang typescript and observe predicate in _missing_examples.

Activity

  1. added
    bug
    core-engine
    threat: false-negative
    on Aug 24, 2026
  2. changed the title [-][TS] Arrow-function regex rejects bodies starting with exclamation mark (!)[/-] [+][TypeScript] Arrow-function regex rejects bodies starting with exclamation mark (!)[/+] on Aug 26, 2026
  3. added this to the v2.4.9 milestone on Aug 31, 2026
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

    bugcore-enginethreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions