fix(ivy): compile pipe in context of ternary operator (#28635)

Previously, it wasn't possible to compile template that contains pipe in context of ternary operator `{{ 1 ? 2 : 0 | myPipe }}` due to the error `Error: Illegal state: Pipes should have been converted into functions. Pipe: async`.

This PR fixes a typo in expression parser so that pipes are correctly converted into functions.

PR Close #28635
This commit is contained in:
Alexey Zuev
2019-02-10 11:41:00 +04:00
committed by Miško Hevery
parent 2ca77da4ca
commit 2bf0d1a56f
3 changed files with 45 additions and 6 deletions

View File

@ -546,7 +546,7 @@ export class AstMemoryEfficientTransformer implements AstVisitor {
const condition = ast.condition.visit(this);
const trueExp = ast.trueExp.visit(this);
const falseExp = ast.falseExp.visit(this);
if (condition !== ast.condition || trueExp !== ast.trueExp || falseExp !== falseExp) {
if (condition !== ast.condition || trueExp !== ast.trueExp || falseExp !== ast.falseExp) {
return new Conditional(ast.span, condition, trueExp, falseExp);
}
return ast;