fix(compiler): detect pipes in ICUs in template binder (#38810)
Recent work on compiler internals in #38539 led to an unexpected failure, where a pipe used exclusively inside of an ICU would no longer be emitted into the compilation output. This caused runtime errors due to missing pipes. The issue occurred because the change in #38539 would determine the set of used pipes up-front, independent from the template compilation using the `R3TargetBinder`. However, `R3TargetBinder` did not consider expressions within ICUs, so any pipe usages within those expressions would not be detected. This fix unblocks #38539 and also concerns upcoming linker work, given that prelink compilations would not go through full template compilation but only `R3TargetBinder`. PR Close #38810
This commit is contained in:
@ -434,7 +434,10 @@ class TemplateBinder extends RecursiveAstVisitor implements Visitor {
|
||||
visitText(text: Text) {}
|
||||
visitContent(content: Content) {}
|
||||
visitTextAttribute(attribute: TextAttribute) {}
|
||||
visitIcu(icu: Icu): void {}
|
||||
visitIcu(icu: Icu): void {
|
||||
Object.keys(icu.vars).forEach(key => icu.vars[key].visit(this));
|
||||
Object.keys(icu.placeholders).forEach(key => icu.placeholders[key].visit(this));
|
||||
}
|
||||
|
||||
// The remaining visitors are concerned with processing AST expressions within template bindings
|
||||
|
||||
|
Reference in New Issue
Block a user