parent
1c9962df67
commit
4a0e9475df
|
@ -304,6 +304,13 @@ FastPath.prototype.needsParens = function(options) {
|
|||
case "MemberExpression":
|
||||
return name === "object" && parent.object === node;
|
||||
|
||||
case "AssignmentExpression":
|
||||
return (
|
||||
parent.left === node &&
|
||||
(node.type === "TSTypeAssertionExpression" ||
|
||||
node.type === "TSAsExpression")
|
||||
);
|
||||
|
||||
case "BinaryExpression":
|
||||
case "LogicalExpression": {
|
||||
if (!node.operator && node.type !== "TSTypeAssertionExpression") {
|
||||
|
|
|
@ -21,6 +21,8 @@ const state = JSON.stringify({
|
|||
next: window.location.href,
|
||||
nonce,
|
||||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
const name = (description as DescriptionObject).name || (description as string);
|
||||
this.isTabActionBar((e.target || e.srcElement) as HTMLElement);
|
||||
|
@ -47,4 +49,6 @@ const state = JSON.stringify({
|
|||
nonce
|
||||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
|
||||
`;
|
||||
|
|
|
@ -18,3 +18,5 @@ const state = JSON.stringify({
|
|||
next: window.location.href,
|
||||
nonce,
|
||||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
|
|
|
@ -51,6 +51,7 @@ exports[`parenthesis.ts 1`] = `
|
|||
<x>a && [];
|
||||
true || <x>a;
|
||||
<x>a + <x>b;
|
||||
(<x>a) = 1;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
<DocumentHighlightKind>(a ? b : c);
|
||||
<any>(() => {});
|
||||
|
@ -59,5 +60,6 @@ true || <x>a;
|
|||
<x>a && [];
|
||||
true || <x>a;
|
||||
<x>a + <x>b;
|
||||
(<x>a) = 1;
|
||||
|
||||
`;
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
<x>a && [];
|
||||
true || <x>a;
|
||||
<x>a + <x>b;
|
||||
(<x>a) = 1;
|
||||
|
|
Loading…
Reference in New Issue