ReviewOS

home-lang/home

Bun parity: align console timer output semantics

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

Scope

Advance the contiguous Bun corpus boundary at js/web/console/console-timeLog.test.ts (position 4094) by matching Bun's console.timeLog / console.timeEnd process output exactly.

Depends on and follows #328.

Current failures

The focused range reports five failures in this file, with 0 unsupported. The first actionable mismatch is:

  • console.timeEnd("") writes two trailing newlines instead of exactly one; Bun expects /^\[[\d.]+[mnµ]?s\]\n$/ on stderr.

The file also covers:

  • empty and non-empty timer labels;
  • duration/unit formatting;
  • stderr/stdout routing and exit status;
  • full console-timeLog.js fixture output parity.

The current failure includes the upstream source location (console-timeLog.test.ts:72:29).

Acceptance criteria

  • js/web/console/console-timeLog.test.ts passes without exclusions or weakened fixtures.
  • Timer output uses the shared native console/timer path and emits exactly one trailing newline.
  • Empty/non-empty labels, units, routing, and fixture output match Bun.
  • Permanent focused regression coverage is added.
  • Timer failures retain the originating operation/test source and useful structured context.
10 days ago

Implemented and pushed in f450f13b1 (fix(runtime): emit one console timer newline).

Root cause: the empty-label branch passed a literal newline to Output.printErrorln, which already appends its own line terminator. Home therefore emitted two 0a bytes while Bun emits one. The branch now prints an empty payload through the shared native timer writer; non-empty label behavior is unchanged.

Verification:

  • raw Home output for console.time(""); console.timeEnd(""): exactly one trailing 0a, matching Bun;
  • non-empty label raw output remains byte-for-byte compatible;
  • clean-cache zig build: pass;
  • js/web/console/console-timeLog.test.ts (4094): 3 passed, 0 failed, 0 unsupported;
  • permanent HTTP/web tail queue with the new entry: pass.

The contiguous verified boundary is now through position 4094.

Sign in to comment on this issue.