Skip to content

fix: split named-object-dispatch if-chains to prevent if-drop bug#133

Merged
cs01 merged 2 commits intomainfrom
fix/named-dispatch-if-drop
Mar 9, 2026
Merged

fix: split named-object-dispatch if-chains to prevent if-drop bug#133
cs01 merged 2 commits intomainfrom
fix/named-dispatch-if-drop

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 9, 2026

Summary

  • Splits 7 dispatch functions in named-object-dispatch.ts that exceeded the 4-branch if-return safety limit
  • handleFsMethod: 27 → 5 sub-functions (≤4 each) + 5-branch coordinator
  • handlePathMethod: 9 → 2 sub-functions (4 each) + 3-branch coordinator
  • handleProcessMethod: 10 → 2 sub-functions (4 each) + 4-branch coordinator
  • handleCryptoMethod: 7 → 1 sub-function (4) + 4-branch coordinator
  • handleSqliteMethod: 7 → 1 sub-function (4) + 4-branch coordinator
  • handleOsMethod: 7 → 1 sub-function (4) + 4-branch coordinator
  • handleAssertMethod: 5 → 1 sub-function (4) + 2-branch coordinator
  • handleChadScriptMethod: 5 → 1 sub-function (4) + 2-branch coordinator
  • Prevents the native compiler's if-drop bug (5th+ consecutive if-return blocks silently dropped)

Test plan

  • All 434 tests pass
  • Self-hosting verification passes (verify:quick)

🤖 Generated with Claude Code

@cs01 cs01 merged commit b7a50b3 into main Mar 9, 2026
12 checks passed
@cs01 cs01 deleted the fix/named-dispatch-if-drop branch March 9, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant