ReviewOS

home-lang/home

Bun parity: align BroadcastChannel custom inspect state

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

Scope

Continue the contiguous Bun corpus from #66 at position 4089:

  • js/web/broadcastchannel/broadcast-channel.test.ts

Current gap

The first ten BroadcastChannel behavior tests reach the final custom-inspect assertion, where Home exposes bootstrap implementation fields instead of Bun's public diagnostic shape.

Expected:

BroadcastChannel { name:
   'hello',
  active:
   true }

Current Home output includes internal fields such as onmessage, onmessageerror, __home_bc_closed, and __home_bc_listeners.

The failing test also verifies that user util.inspect options (compact: true, breakLength: 2) are forwarded through the custom inspector.

Acceptance criteria

  • expose Bun's BroadcastChannel { name, active } custom-inspect shape
  • hide adapter implementation fields from inspection
  • forward user inspect options without hard-coded formatting
  • preserve behavior/lifecycle tests in the same upstream file
  • pass all 11 upstream tests with no TODO or unsupported accounting
  • add a focused permanent inspect regression with useful operation/cause stack diagnostics if formatting fails

Follows the worker teardown fix in #326.

10 days ago

Completed in c1415027a (fix(runtime): align BroadcastChannel inspection) and pushed to main.

Implemented Bun's custom inspection contract for BroadcastChannel:

  • renders only { name, active }
  • forwards caller inspection options and decrements nested depth like Bun
  • reflects live closed state
  • keeps Home's registry/listener bookkeeping non-enumerable
  • adds a permanent regression for exact multiline formatting, closed-state output, and hidden adapter internals

Verification:

  • upstream js/web/broadcastchannel/broadcast-channel.test.ts: 11 passed, 0 failed, 0 unsupported
  • permanent focused BroadcastChannel regression: passed
  • contiguous follow-ups at positions 4090-4091: 2 files, 2 passed, 0 failed, 0 unsupported
  • zig fmt --check packages/home_test/src/corpus_runner.zig: passed
  • zig build: passed

Sign in to comment on this issue.