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

Correctly parse TS TypeAssertions around arrow functions #9699

Merged
merged 1 commit into from Mar 19, 2019
Merged

Correctly parse TS TypeAssertions around arrow functions #9699

merged 1 commit into from Mar 19, 2019

Conversation

danez
Copy link
Member

@danez danez commented Mar 18, 2019

Q                       A
Fixed Issues? Fixes #9324
Patch: Bug Fix? 👻
Major: Breaking Change? n
Minor: New Feature? n
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Prior to this change it would only work if createParenthesizedExpressions was true, because we already check if the node is not an ArrowFunctionExpression. Now it also works with this setting set to false.

@danez danez added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Mar 18, 2019
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10517/

@danez danez merged commit 48d66eb into babel:master Mar 19, 2019
@danez danez deleted the fix-9324 branch March 19, 2019 05:18
@@ -0,0 +1,4 @@
{
"createParenthesizedExpressions": true,
Copy link
Contributor

@armano2 armano2 Mar 20, 2019

Choose a reason for hiding this comment

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

@nicolo-ribaudo, @existentialism should we add this option to babel-plugin-syntax-typescript?

Copy link
Member Author

Choose a reason for hiding this comment

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

No this is only for tools using babel-parser directly.
Babel would not understand the AST that gets returned when this option is active.

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@babel/parser(ts): type assertion with arrow function
5 participants