Skip to content

Conversation

trzeciak
Copy link
Contributor

@trzeciak trzeciak commented Oct 2, 2024

Add support for wasm WebAssembly.Exception (uncaught exception in emscripten).

References

@s1gr1d s1gr1d requested a review from timfish October 3, 2024 07:24
@s1gr1d
Copy link
Member

s1gr1d commented Oct 3, 2024

Thanks for adding this PR 🙌
I added a commit with some TS fixes and tests. From my side it looks good :)

@s1gr1d s1gr1d requested a review from Lms24 October 3, 2024 08:35
@lforst lforst self-assigned this Oct 3, 2024
@lforst lforst removed the request for review from timfish October 3, 2024 13:50
Copy link
Contributor

@lforst lforst left a comment

Choose a reason for hiding this comment

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

Thanks!

@chargome
Copy link
Member

chargome commented Feb 6, 2025

@trzeciak these tests fail on Node 20 as apparently there is no exception.message – any idea if there was dropped support? Could not find anything

@trzeciak
Copy link
Contributor Author

trzeciak commented Feb 7, 2025

@chargome I'm not entirely sure what you mean, but I'm not a JavaScript developer, just a C++ developer, and these changes are specifically to support C++ exceptions compiled to wasm and caught by JavaScript (it's a bit complicated 🙈).
If you're asking whether wasm can still throw exceptions in the browser, then yes it can: https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Exception
I don't know how it looks in node, it's possible that you need to update one of the new functions when the environment is node: isWebAssemblyException / extractType.

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.

4 participants