fix(ivy): more accurate detection of pipes in host bindings (#34655)

Pipes in host binding expressions are not supported in View Engine and Ivy, but in some more complex cases (like `(value | pipe) === true`) compiler was not reporting errors. This commit extends Ivy logic to detect pipes in host binding expressions and throw in cases bindings are present. View Engine behavior remains the same.

PR Close #34655
This commit is contained in:
Andrew Kushnir
2020-01-06 17:27:29 -08:00
committed by Matias Niemelä
parent def4127bf1
commit 39ec188003
3 changed files with 82 additions and 21 deletions

View File

@ -12,7 +12,7 @@ import {ConstantPool} from '../../constant_pool';
import * as core from '../../core';
import {AST, AstMemoryEfficientTransformer, BindingPipe, BindingType, FunctionCall, ImplicitReceiver, Interpolation, LiteralArray, LiteralMap, LiteralPrimitive, ParsedEventType, PropertyRead} from '../../expression_parser/ast';
import {Lexer} from '../../expression_parser/lexer';
import {Parser} from '../../expression_parser/parser';
import {IvyParser} from '../../expression_parser/parser';
import * as i18n from '../../i18n/i18n_ast';
import * as html from '../../ml_parser/ast';
import {HtmlParser} from '../../ml_parser/html_parser';
@ -2004,7 +2004,8 @@ const elementRegistry = new DomElementSchemaRegistry();
*/
export function makeBindingParser(
interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG): BindingParser {
return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, null, []);
return new BindingParser(
new IvyParser(new Lexer()), interpolationConfig, elementRegistry, null, []);
}
export function resolveSanitizationFn(context: core.SecurityContext, isAttribute?: boolean) {