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

Integration with try/catch #18

Closed
littledan opened this issue Jul 4, 2017 · 1 comment
Closed

Integration with try/catch #18

littledan opened this issue Jul 4, 2017 · 1 comment

Comments

@littledan
Copy link
Member

I've been hoping that we could eventually get some way of having multiple catch blocks which switch on which type of exception is thrown. The key here would be, if none of them match, it implicitly rethrows. This is a feature of most other languages with exceptions.

This pattern matching proposal ended up pretty differently from what might be more useful there. One problem is, we already do destructuring on the catch variable, so we can't start applying a different grammar.

Do you see extensions that would allow it to be used in a context like this? One alternative would be https://github.com/zenparsing/es-typed-catch . I guess the viability of this ties into the answer to #13 as well.

@littledan
Copy link
Member Author

Oh sorry, this is a duplicate of #14

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

No branches or pull requests

1 participant