Skip to content

Fix stack overflow when inspecting circular JSX elements - #30021

Closed
robobun wants to merge 1 commit into
mainfrom
farm/deb3abed/fix-jsx-circular-inspect
Closed

Fix stack overflow when inspecting circular JSX elements#30021
robobun wants to merge 1 commit into
mainfrom
farm/deb3abed/fix-jsx-circular-inspect

Fix stack overflow when inspecting circular JSX elements

4a9bec5
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed May 1, 2026 in 21m 31s

Code review found 1 important issue

Found 2 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/bun.js/ConsoleObject.zig:1139 Same circular-JSX stack overflow remains in JestPrettyFormat (expect() diff output)

Annotations

Check failure on line 1139 in src/bun.js/ConsoleObject.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Same circular-JSX stack overflow remains in JestPrettyFormat (expect() diff output)

The same fix is needed in the sister formatter `src/bun.js/test/pretty_format.zig` — its `canHaveCircularReferences()` (lines 328-330) still omits `.JSX`, so a circular React element passed to a failing `expect()` matcher (e.g. `expect(el).toBe(null)`) still recurses unboundedly in `DiffFormatter` → `JestPrettyFormat` and SIGSEGVs. Mirroring this one-line change there (and ideally also adding `.Error`/`.Event`/`.Function`/`.Class` for parity) would close the remaining hole.