Require parenthesis around "TSAsExpression" inside an "UpdateExpression" (#4183)

master
Jeff Lau 2018-03-21 10:38:10 -04:00 committed by Lucas Duailibe
parent 5b8e0e6201
commit 24f45d1b50
3 changed files with 4 additions and 0 deletions

View File

@ -320,6 +320,7 @@ FastPath.prototype.needsParens = function(options) {
case "AwaitExpression":
case "TSAsExpression":
case "TSNonNullExpression":
case "UpdateExpression":
return true;
case "MemberExpression":

View File

@ -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;

View File

@ -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;