feat(compiler): support safe keyed read expressions (#41911)

Currently we support safe property (`a?.b`) and method (`a?.b()`) accesses, but we don't handle safe keyed reads (`a?.[0]`) which is inconsistent. These changes expand the compiler in order to support safe key read expressions as well.

PR Close #41911
This commit is contained in:
Kristiyan Kostadinov
2021-05-01 18:46:34 +02:00
committed by Jessica Janiuk
parent 47270d9e63
commit ba084857ea
21 changed files with 385 additions and 50 deletions
@@ -114,6 +114,10 @@ class ExpressionSourceHumanizer extends e.RecursiveAstVisitor implements t.Templ
this.recordAst(ast);
super.visitQuote(ast, null);
}
visitSafeKeyedRead(ast: e.SafeKeyedRead) {
this.recordAst(ast);
super.visitSafeKeyedRead(ast, null);
}
visitNgContent(ast: t.NgContentAst) {}
visitEmbeddedTemplate(ast: t.EmbeddedTemplateAst) {