Require parenthesis around "TSAsExpression" inside an "UpdateExpression" (#4183)
parent
5b8e0e6201
commit
24f45d1b50
|
@ -320,6 +320,7 @@ FastPath.prototype.needsParens = function(options) {
|
|||
case "AwaitExpression":
|
||||
case "TSAsExpression":
|
||||
case "TSNonNullExpression":
|
||||
case "UpdateExpression":
|
||||
return true;
|
||||
|
||||
case "MemberExpression":
|
||||
|
|
|
@ -24,6 +24,7 @@ const state = JSON.stringify({
|
|||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
(foo.bar as any)++;
|
||||
|
||||
(bValue as boolean) ? 0 : -1;
|
||||
<boolean>bValue ? 0 : -1;
|
||||
|
@ -59,6 +60,7 @@ const state = JSON.stringify({
|
|||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
(foo.bar as any)++;
|
||||
|
||||
(bValue as boolean) ? 0 : -1;
|
||||
<boolean>bValue ? 0 : -1;
|
||||
|
|
|
@ -21,6 +21,7 @@ const state = JSON.stringify({
|
|||
} as State);
|
||||
|
||||
(foo.bar as Baz) = [bar];
|
||||
(foo.bar as any)++;
|
||||
|
||||
(bValue as boolean) ? 0 : -1;
|
||||
<boolean>bValue ? 0 : -1;
|
||||
|
|
Loading…
Reference in New Issue