Skip to content

[TS] Compute Array.join from elements and separator #433

Closed

Description

@CaelmBleidd

Resolution (2026-10-14)

Audited against usvm main at 19866c959d.

Array.join computes from elements and separator through the source model, with nullish/runtime-kind handling and explicit residual conversions. Concrete Number formatting and symbolic safe integers are supported; symbolic fractions/unsafe integers remain residual. Implementation: usvm #410.

Validation: All 11 TsGapModelsSourceTest regressions passed, including join composition, numeric boundaries and native replay.

Original report and acceptance context, retained for traceability

Problem

The Array.join approximation returns the same fixed string regardless of array contents or separator.

Minimal TypeScript example

export function joined(): string {
  return [1, 2].join("-");
}

Expected behavior

joined() returns "1-2". Convert elements in order, honor the separator and preserve the supported sparse/undefined behavior. Keep unsupported element conversions explicit.

Current source evidence

Join approximation.

Checked against USVM main 53dce8f3bca2713642c783ba8308a6a360a9e516. This exact snippet is a proposed regression from source audit; it has not yet been run as a new end-to-end test. #368 audits the existing call approximations but does not implement these individual fixes.

Acceptance criteria

  • A focused test checks the symbolic outcome without reporting an approximation as exact semantics.
  • The supported case agrees with concrete TypeScript/Node.js replay.
  • Unsupported operand or environment cases remain explicit.
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions