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

Add destructuring to catch clause #7990

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

goodmind
Copy link
Contributor

@goodmind goodmind commented Aug 5, 2019

Fixes #6636

I also moved location of error to be more accurate when there is type annotation

@goodmind goodmind changed the title Add destructuring to catch Add destructuring to catch clause Aug 5, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@panagosg7 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@goodmind
Copy link
Contributor Author

goodmind commented Aug 6, 2019

Not sure if this is considered type annotation?

try {

} catch ({message = 'foo'}) {
  message // type is string
}

@goodmind
Copy link
Contributor Author

/cc @panagosg7 anything here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

destructuring catch parameter throws Error
2 participants