Skip to content

fix: split 35+ consecutive if-return chain in calls.ts#158

Merged
cs01 merged 1 commit intomainfrom
fix/split-if-drop-chains-in-calls
Mar 9, 2026
Merged

fix: split 35+ consecutive if-return chain in calls.ts#158
cs01 merged 1 commit intomainfrom
fix/split-if-drop-chains-in-calls

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 9, 2026

Summary

  • Split the generate() method in CallExpressionGenerator which had 35+ consecutive if-return blocks into 11 helper methods, each with ≤4 consecutive if-return blocks
  • The native compiler's if-drop bug silently drops the 5th+ consecutive if-return block, causing function dispatch to fall through to generateGenericCall instead of the correct handler
  • Affected functions: malloc, free, socket, bind, listen, accept, all _ts* tree-sitter APIs, btoa, atob, encodeURIComponent, decodeURIComponent, and more

Test plan

  • All 437 tests pass
  • verify:quick passes (tsc + Stage 0 + Stage 1 + tests)

🤖 Generated with Claude Code

@cs01 cs01 merged commit 2da9a17 into main Mar 9, 2026
12 checks passed
@cs01 cs01 deleted the fix/split-if-drop-chains-in-calls branch March 12, 2026 05:35
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