Skip to content

createExportAssignment: parenthesize nested class or function expression #25341

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

Merged
merged 5 commits into from
Jul 6, 2018

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Jun 30, 2018

Fixes: #25222

@mhegazy mhegazy requested review from rbuckton and weswigham July 3, 2018 22:19
@mhegazy
Copy link
Contributor

mhegazy commented Jul 3, 2018

@rbuckton can you please review

let needsParens = check.kind === SyntaxKind.CommaListExpression ||
isBinaryExpression(check) && check.operatorToken.kind === SyntaxKind.CommaToken;
if (!needsParens) {
switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) {
Copy link
Member

Choose a reason for hiding this comment

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

If e is already a parenthesizedExpression, won't this cause it to be double parenthesized?

Copy link
Member

Choose a reason for hiding this comment

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

nvm getLeftmostExpression doesn't skip parenthesis. Looks fine.

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

Probably needs a fix with the merge conflict from your other PR, tho 😛

@mhegazy mhegazy merged commit fd007e7 into microsoft:master Jul 6, 2018
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

Successfully merging this pull request may close these issues.

3 participants