ReviewOS

home-lang/home

TypeScript transpiler: strip invalid block-scoped function exports

#578
Closed chris opened this 11 days ago ·
11 days ago

Follow-up to #66 from the unchanged pinned Bun transpiler corpus at source pin 4982b91e3702094330f3be3883354c52b8c01323.

Home correctly rejects a block-scoped function export in JavaScript/JSX, but for TypeScript it emits a dangling export { encrypt }; after lowering the block function. Bun strips that export like a type-only export while preserving valid top-level function exports and block-scoped var behavior.

Acceptance: all unchanged cases under export of a block-scoped function declaration pass without weakening parser diagnostics.

11 days ago

Resolved by 661d06dc87ceb3ee1af6643ff362d80947e8d33f. Strict-mode block functions now stop at their block scope independently of the renamer; only the Annex-B sloppy-mode sibling transform remains gated by renaming. All seven unchanged cases pass across JS, JSX, TypeScript, valid exports, sloppy mode, and module execution.

Sign in to comment on this issue.