Skip to content

refactor: extract if-chains from dispatchNamedObject to prevent if-drop bug#126

Merged
cs01 merged 1 commit intomainfrom
fix/extract-dispatch-chains
Mar 8, 2026
Merged

refactor: extract if-chains from dispatchNamedObject to prevent if-drop bug#126
cs01 merged 1 commit intomainfrom
fix/extract-dispatch-chains

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 8, 2026

Summary

  • Extracts process, assert, os, console, ChadScript, and sqlite dispatch chains from dispatchNamedObject() into standalone functions in named-object-dispatch.ts
  • Follows the existing pattern used by handleFsMethod, handleCryptoMethod, handlePathMethod, etc.
  • Removes the dispatchSqliteMethod private class method in favor of a standalone function for consistency
  • Reduces the number of consecutive if-return blocks within dispatchNamedObject() from 10+ to 0, mitigating the native compiler's if-drop bug that drops 5th+ consecutive if-return blocks

Test plan

  • All 432 tests pass
  • Self-hosting verification passes (verify:quick)
  • Prettier formatting check passes
  • No new functionality — pure refactor moving existing code to standalone functions

🤖 Generated with Claude Code

@cs01 cs01 merged commit 0788840 into main Mar 8, 2026
12 checks passed
@cs01 cs01 deleted the fix/extract-dispatch-chains 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