fix(angular): add missing parens for pipe in ternary (#5397)

master
Ika 2018-11-09 09:51:54 +08:00 committed by GitHub
parent 9acb02997a
commit 423ddf9abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -513,6 +513,7 @@ function needsParens(path, options) {
case "SpreadProperty":
case "BinaryExpression":
case "LogicalExpression":
case "NGPipeExpression":
case "ExportDefaultDeclaration":
case "AwaitExpression":
case "JSXSpreadAttribute":

View File

@ -36,7 +36,8 @@ exports[`pipe-expression.ng - __ng_interpolation-verify 1`] = `
keyA: reallySuperLongValue,
keyB: shortValue | pipeB | pipeC: valueToPipeC
}
| aaa
| aaa,
(hideLinqPanel ? "ReportSelection.HideShowLabel_Show.String" : "ReportSelection.HideShowLabel_Hide.String") | localize:(localizationSection)
]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[
@ -63,6 +64,10 @@ exports[`pipe-expression.ng - __ng_interpolation-verify 1`] = `
keyA: reallySuperLongValue,
keyB: shortValue | pipeB | pipeC: valueToPipeC
}
| aaa
| aaa,
(hideLinqPanel
? "ReportSelection.HideShowLabel_Show.String"
: "ReportSelection.HideShowLabel_Hide.String")
| localize: localizationSection
]
`;

View File

@ -20,5 +20,6 @@
keyA: reallySuperLongValue,
keyB: shortValue | pipeB | pipeC: valueToPipeC
}
| aaa
| aaa,
(hideLinqPanel ? "ReportSelection.HideShowLabel_Show.String" : "ReportSelection.HideShowLabel_Hide.String") | localize:(localizationSection)
]