Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch Rust panics and then throw them in JS #5383

Merged
merged 3 commits into from
Feb 9, 2024
Merged

Catch Rust panics and then throw them in JS #5383

merged 3 commits into from
Feb 9, 2024

Conversation

TrickyPi
Copy link
Member

@TrickyPi TrickyPi commented Feb 8, 2024

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
resolves #5379

Description

At the moment, it doesn't work on WASM.

Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 6:04am

Copy link

github-actions bot commented Feb 8, 2024

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#fix/5379

Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.

or load it into the REPL:
https://rollup-1e7pgcwim-rollup-js.vercel.app/repl/?pr=5383

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (14425f9) 98.81% compared to head (04b6287) 98.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5383   +/-   ##
=======================================
  Coverage   98.81%   98.81%           
=======================================
  Files         232      232           
  Lines        8997     8999    +2     
  Branches     2347     2348    +1     
=======================================
+ Hits         8890     8892    +2     
  Misses         46       46           
  Partials       61       61           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TrickyPi TrickyPi changed the title Catch Rust panics and then throw them in Node Catch Rust panics and then throw them in JS Feb 8, 2024
Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Thanks, that is really good to have!

At the moment, it doesn't work on WASM.

Why, what happens in WASM? Is it fixable or is it a shortcoming of the WASM target?

@lukastaegert lukastaegert mentioned this pull request Feb 8, 2024
9 tasks
@TrickyPi
Copy link
Member Author

TrickyPi commented Feb 8, 2024

Why, what happens in WASM? Is it fixable or is it a shortcoming of the WASM target?

It seems that catch_unwind doesn't work on WASM by default. I'm looking for a way to fix it, maybe there are some helpful information here: rust-lang/rust#111322.

@lukastaegert lukastaegert added this pull request to the merge queue Feb 9, 2024
Merged via the queue into master with commit 51226e3 Feb 9, 2024
28 checks passed
@lukastaegert lukastaegert deleted the fix/5379 branch February 9, 2024 05:13
@curran
Copy link
Contributor

curran commented Feb 9, 2024

Amazing! Thank you so much.

Copy link

This PR has been released as part of rollup@4.10.0. You can test it via npm install rollup.

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.

NodeJS Core Dump on Specific Syntax Error (Prop::Assign)
3 participants