ReviewOS

home-lang/home

Bun parity: stop TypeScript rewrite false positives in JS object values

#335
Closed chris opened this 10 days ago ·
10 days ago

Scope

Fix corpus position 4104 (js/web/encoding/text-encoder.test.js) by correcting the bootstrap TypeScript-rewrite detector.

Root cause

The raw : Array marker treats valid JavaScript object values such as bytes: Array.from(...) as TypeScript annotations. The mechanical type stripper then produces invalid JavaScript (Unexpected token {; expected : in ternary operator).

Acceptance

  • constructor/member/call object values do not trigger TypeScript stripping
  • actual Array<...> annotations still trigger it
  • add a focused detector regression test
  • execute the complete TextEncoder corpus logically
  • preserve structured parse/evaluation diagnostics
  • pin position 4104 in the permanent queue
  • focused corpus, queue, and clean build pass

Tracking from #66.

10 days ago

Fixed on main by 191c289 (fix(test): avoid JavaScript type-strip false positives). The bootstrap detector now distinguishes standalone dynamic import syntax from generated __home_import helpers and ignores constructor-valued JavaScript object fields such as bytes: Array.from(...) and url: URL(...), while retaining real TypeScript annotations and dynamic imports. Added focused detector coverage and pinned js/web/encoding/text-encoder.test.js in the permanent HTTP/web queue at 42 passes. Verified the focused file at corpus position 4104 (42 passed, 0 failed, 0 todo, 0 unsupported), the full HTTP/web tail regression queue, and a clean zig build.

Sign in to comment on this issue.