Skip to content

Conversation

@spotandjake
Copy link
Member

@spotandjake spotandjake commented Dec 6, 2025

This pr is based off the work done in #197 and implements try catch.

This is up to date as of v124 & v125.

Closes: #189, #197

@spotandjake spotandjake self-assigned this Dec 6, 2025
@spotandjake spotandjake changed the base branch from philip/add-try-catch to main December 6, 2025 17:54
@spotandjake spotandjake changed the title feat: Correct try catch bindings feat: Try Catch Bindings Dec 6, 2025
@spotandjake spotandjake changed the title feat: Try Catch Bindings feat: Add bindings for exception handling (try/catch/throw/rethrow) Dec 6, 2025
@spotandjake spotandjake added the Api Issues or pull requests relating to implementing or modifying a binaryen api. label Dec 6, 2025
Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall! Because rethrow and delegation are a part of the legacy exception handling API, let's remove those.

Similar to how we do for data segments, let's make the API for Try.make a little more manageable by taking the tag/catch bodies together as a list of tuples or records, and accept a catch_all parameter that will append that last catch body, so it's not implicit.

@spotandjake spotandjake force-pushed the spotandjake/try-catch-corrections branch from 9cb1e3d to 45614d6 Compare December 21, 2025 19:27
@spotandjake
Copy link
Member Author

I made those changes

@ospencer
Copy link
Member

Just one comment update and this is good to go.

@ospencer ospencer changed the title feat: Add bindings for exception handling (try/catch/throw/rethrow) feat: Add bindings for exception handling (try/throw) Dec 28, 2025
@spotandjake
Copy link
Member Author

I made that change

@ospencer ospencer merged commit bc003c7 into main Dec 29, 2025
12 checks passed
@ospencer ospencer deleted the spotandjake/try-catch-corrections branch December 29, 2025 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Api Issues or pull requests relating to implementing or modifying a binaryen api.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need try, throw, and rethrow bindings

4 participants