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
fix(parser): Handle trailing comma and bracket after arrow fn in conditional in TS #3685
fix(parser): Handle trailing comma and bracket after arrow fn in conditional in TS #3685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
swc-bump:
- swc_ecma_parser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is failing due to parsing error.
I think we should use some context to see if we can eat ,
Oops missed that, let me take a look |
could you add another test case? f(a ? (): void => { } : (): void => { }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the test?
Yep will do. Had a busy day with work yesterday but will do it today |
….com/williamtetlow/swc into handle-trailing-comma-after-arrow-fn
@kdy1 sorry busy week with work only just got round to fixing this. Added test requested by @magic-akari in f6f0623 Also had to remove test for #2174. This is actually invalid syntax in TS see https://www.typescriptlang.org/play?#code/MYewdgzgLgBAHjAvDA3gKBpmAHATibALhgEsIBhEXXAU2CgyyYH4YAzMJAPhgAoUYAXwCUjJuJjEO3GFFwBXGgBo0ggNxA |
Hmm is https://github.com/swc-project/swc/runs/5331608290?check_suite_focus=true Edit: |
@@ -1,5 +0,0 @@ | |||
const x = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you delete this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdy1 I commented above. This isn't valid TS syntax
Also had to remove test for #2174. This is actually invalid syntax in TS see https://www.typescriptlang.org/play?#code/MYewdgzgLgBAHjAvDA3gKBpmAHATibALhgEsIBhEXXAU2CgyyYH4YAzMJAPhgAoUYAXwCUjJuJjEO3GFFwBXGgBo0ggNxA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's valid JavaScript though. This is just a failing of the TS compiler.
Sorry, I missed it. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
swc-bump:
- swc_ecma_parser
Description:
fixes #3672
fixes syntax
BREAKING CHANGE:
Related issue (if exists):
#3672