( job: HostBindingCompilationJob, property: e.ParsedProperty, bindingKind: ir.BindingKind, securityContexts: SecurityContext[], )
| 143 | // TODO: We should refactor the parser to use the same types and structures for host bindings as |
| 144 | // with ordinary components. This would allow us to share a lot more ingestion code. |
| 145 | export function ingestDomProperty( |
| 146 | job: HostBindingCompilationJob, |
| 147 | property: e.ParsedProperty, |
| 148 | bindingKind: ir.BindingKind, |
| 149 | securityContexts: SecurityContext[], |
| 150 | ): void { |
| 151 | let expression: o.Expression | ir.Interpolation; |
| 152 | const ast = property.expression.ast; |
| 153 | if (ast instanceof e.Interpolation) { |
| 154 | expression = new ir.Interpolation( |
| 155 | ast.strings, |
| 156 | ast.expressions.map((expr) => convertAst(expr, job, property.sourceSpan)), |
| 157 | [], |
| 158 | ); |
| 159 | } else { |
| 160 | expression = convertAst(ast, job, property.sourceSpan); |
| 161 | } |
| 162 | job.root.update.push( |
| 163 | ir.createBindingOp( |
| 164 | job.root.xref, |
| 165 | bindingKind, |
| 166 | property.name, |
| 167 | expression, |
| 168 | null, |
| 169 | securityContexts, |
| 170 | false, |
| 171 | false, |
| 172 | null, |
| 173 | /* TODO: How do Host bindings handle i18n attrs? */ null, |
| 174 | property.sourceSpan, |
| 175 | ), |
| 176 | ); |
| 177 | } |
| 178 | |
| 179 | export function ingestHostAttribute( |
| 180 | job: HostBindingCompilationJob, |
no test coverage detected