Skip to content

[TS] Evaluate computed keys in destructuring bindings #384

Closed

Description

@CaelmBleidd

Problem

A computed object-binding key is not lowered as an evaluated runtime property name.

Minimal TypeScript example

export function pick(input: Record<string, number>, key: string): number {
  const { [key]: value } = input;
  return value;
}

Expected behavior

pick({x:3}, "x") returns 3. Evaluate key once and bind the value of that property. Keep this separate from computed keys in object-literal construction.

Current source evidence

Binding-pattern lowering.

Checked against JacoDB neo 873f8e99faf3f1e4736935be96ce1c319985c574. This exact snippet is a proposed regression from source audit; it has not yet been run as a new end-to-end test.

Acceptance criteria

  • A native-frontend regression verifies the relevant EtsIR shape and JSON round trip.
  • The example's observable result/evaluation order agrees with TypeScript/Node.js when a consuming execution model is available.
  • Until implemented, the frontend reports this construct as unsupported rather than silently substituting unrelated semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions