Conversation
…till left to do: - hide the public API (and tests) behind a feature flag - add tests for nested `TryCatch` instances on the stack - add panic handler and tests to ensure panics get caught by try_catch
kjvalencik
reviewed
Jul 8, 2020
kjvalencik
reviewed
Jul 9, 2020
- Implement panic propagation - Add tests for panic and regular return value
… for the dynamic tests.
kjvalencik
reviewed
Jul 13, 2020
…ic `try_catch` API.
kjvalencik
approved these changes
Jul 14, 2020
kjvalencik
reviewed
Jul 14, 2020
| result | ||
| } | ||
|
|
||
| #[cfg(all(feature = "try-catch-api", feature = "napi-runtime"))] |
Member
There was a problem hiding this comment.
Note: For the final documented version, it would be beneficial to include the behavior that this method will panic if a user manually constructs an Err(Throw).
Collaborator
Author
There was a problem hiding this comment.
Yeah, when we un-feature-gate it, it'll need API docs. In the meantime I'll make sure that gets added to the RFC.
Member
There was a problem hiding this comment.
I'll try to add an Exceptions section to the guides docs soon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the
cx.try_catchAPI of RFC 29. I had to make a few changes to the signature oftry_catchto make the types work out; I'll update the RFC to match.Still left to do:
TryCatchinstances on the stackMaybeUninitinstead ofmem::zeroed()Boxand the "unlikely" branchundefinedon unexpectedErr(Throw)T: Valueinstead ofJsValue