parent
19cd7d3227
commit
8bbbc3a6f3
|
@ -305,7 +305,7 @@ FastPath.prototype.needsParens = function(options) {
|
|||
|
||||
case "BinaryExpression":
|
||||
case "LogicalExpression": {
|
||||
if (!node.operator) {
|
||||
if (!node.operator && node.type !== "TSTypeAssertionExpression") {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,18 @@
|
|||
exports[`parenthesis.ts 1`] = `
|
||||
<DocumentHighlightKind>(a ? b : c);
|
||||
<any>(() => {});
|
||||
|
||||
<x>a || {};
|
||||
<x>a && [];
|
||||
true || <x>a;
|
||||
<x>a + <x>b;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<DocumentHighlightKind>(a ? b : c);
|
||||
<any>(() => {});
|
||||
|
||||
<x>a || {};
|
||||
<x>a && [];
|
||||
true || <x>a;
|
||||
<x>a + <x>b;
|
||||
|
||||
`;
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
<DocumentHighlightKind>(a ? b : c);
|
||||
<any>(() => {});
|
||||
|
||||
<x>a || {};
|
||||
<x>a && [];
|
||||
true || <x>a;
|
||||
<x>a + <x>b;
|
||||
|
|
Loading…
Reference in New Issue