Skip to content

[TS] Execute export-default expressions during module initialization #378

Closed

Description

@CaelmBleidd

Problem

ExportAssignment is skipped while lowering the module body, so an exported expression is not evaluated.

Minimal TypeScript example

let count = 0;
function sideEffect(): number { count++; return count; }
export default sideEffect();

Expected behavior

Module initialization calls sideEffect() once and exports the returned value 1. Preserve its side effects and the exported binding in EtsIR.

Current source evidence

Export assignment handling; export metadata.

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

Acceptance criteria

  • The native TypeScript frontend emits EtsIR preserving the behavior above, including a JSON round trip.
  • A focused regression checks the observable result against TypeScript/Node.js.
  • Until implemented, the construct remains an explicit unsupported outcome; it is not silently represented as ordinary supported behavior.

Activity

  1. CaelmBleidd commented on Oct 3, 2026

    @CaelmBleidd
    MemberAuthor

    Вычисление export default при инициализации модуля реализовано в neo через PR #394; сохранены порядок и экспортируемое значение.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions