- Notifications
You must be signed in to change notification settings - Fork335
Reproduce issue #426#427
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Meir017 commentedOct 12, 2020
@lucivpav I just ran into this issue too. Lines 946 to 949 inab53cd5
this should be varstrExpr=expr.toString();if(strExpr[0]==='{'||strExpr[strExpr.length-1]==='}'){expr=['(',expr,')'];} I'm pretty sure the last character cannot be part of the comment, in that case the comment would not be part of the node |
lucivpav commentedOct 14, 2020
I wonder if this fix works for the affected parenthesized expressions in general, or just in function bodies 🤔 |
Meir017 commentedOct 14, 2020
@lucivpav a better solution is to check the node types: if(node.type===Syntax.ArrowFunctionExpression&&node.body.type===Syntax.ObjectExpression){expr=['(',expr,')'];} |
Itazulay commentedJan 21, 2021
@lucivpav This PR does not cover this scenario: |
lucivpav commentedJan 31, 2021
@Itazulay my new PR is implementing it properly IMO |
Uh oh!
There was an error while loading.Please reload this page.
Reproduces#426