angular/packages/compiler/test/expression_parser
JoostK db6cf7e7c1 fix(compiler): allow banana-in-a-box bindings to end with non-null assertion (#37809)
For two-way-bindings that use the banana-in-a-box syntax, the compiler
synthesizes an event assignment expression from the primary expression.
It is valid for the primary expression to be terminated by the non-null
operator, however naive string substitution is used for the synthesized
expression, such that the `!` would immediately precede the `=` token,
resulting in the valid `!=` operator token. The expression would still
parse correctly but it doesn't implement the proper semantics, resulting
in incorrect runtime behavior.

Changing the expression substitution to force a space between the
primary expression and the assignment avoids this mistake, but it
uncovers a new issue. The grammar does not allow for the LHS of an
assignment to be the non-null operator, so the synthesized expression
would fail to parse. To alleviate this, the synthesized expression is
parsed with a special parser flag to allow for this syntax.

Fixes #36551

PR Close #37809
2022-02-07 10:46:52 -08:00
..
utils refactor(compiler): remove parsing support for quote expressions (#44915) 2022-01-31 23:31:11 +00:00
ast_spec.ts refactor(compiler): combine call ASTs (#42882) 2021-09-21 20:55:29 +00:00
BUILD.bazel build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
lexer_spec.ts feat(compiler): add support for safe calls in templates (#44580) 2022-01-11 17:32:47 +00:00
parser_spec.ts fix(compiler): allow banana-in-a-box bindings to end with non-null assertion (#37809) 2022-02-07 10:46:52 -08:00