add new expression as a valid conditional expression parent for parantheses insertion - fixes #578
This commit is contained in:
parent
3607689fbc
commit
d78a01086d
@ -151,9 +151,11 @@ exports.ConditionalExpression = function (node, parent) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t.isCallExpression(parent) && parent.callee === node) {
|
if (t.isCallExpression(parent) || t.isNewExpression(parent)) {
|
||||||
|
if (parent.callee === node) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (t.isConditionalExpression(parent) && parent.test === node) {
|
if (t.isConditionalExpression(parent) && parent.test === node) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user