ReviewOS

home-lang/home

Activate Bun.Transpiler REPL mode corpus

#91
Closed chris opened this 9 days ago ·
9 days ago

The current upstream js/bun/transpiler/repl-transform.test.ts fixture is still replaced with a synthetic TODO even though Home carries Bun parser REPL transforms. Activating it exposes three missing end-to-end semantics:

  • the native transpiler bridge does not propagate replMode or disable DCE/object-literal ambiguity as Bun does
  • Home Zig parser rewrites top-level REPL this to CommonJS exports, unlike current Bun
  • the corpus node:vm shim does not persist top-level declarations on the context object

Acceptance criteria:

  • execute the unmodified current Bun fixture instead of a TODO
  • preserve top-level this in parser REPL mode
  • support top-level await and object-literal disambiguation
  • persist variables, functions, classes, and destructuring across vm context evaluations
  • pass the exact fixture (36/36) and the complete home_test gate

This continues #66 and #81 after #90.

9 days ago

Completed and pushed to main in e2377b8 (feat(test): activate transpiler repl mode corpus).

What landed:

  • activated the unmodified current Bun repl-transform.test.ts fixture
  • propagated replMode into the persistent native transpiler handle and real parser flags
  • disabled DCE and disambiguated leading object literals in REPL mode, matching Bun
  • ported current Bun parser behavior that preserves top-level REPL this instead of rewriting it to CommonJS exports
  • made node:vm context evaluation persist top-level declarations and use the context as the REPL receiver
  • scoped the non-REPL await bar() diagnostic so top-level REPL await reaches the parser
  • added a repository regression that executes the full upstream matrix

Verification:

  • exact upstream fixture: 36 passed, 0 failed, 0 unsupported, 0 todo
  • debug build: passed
  • Zig formatting and diff checks: passed
  • complete home_test gate: passed with zero failures

Commit author and committer are Chris chrisbreuer93@gmail.com; no coauthors.

Sign in to comment on this issue.