( job: HostBindingCompilationJob, property: e.ParsedProperty, bindingKind: ir.BindingKind, securityContexts: SecurityContext[], )
| 187 | // TODO: We should refactor the parser to use the same types and structures for host bindings as |
| 188 | // with ordinary components. This would allow us to share a lot more ingestion code. |
| 189 | export function ingestDomProperty( |
| 190 | job: HostBindingCompilationJob, |
| 191 | property: e.ParsedProperty, |
| 192 | bindingKind: ir.BindingKind, |
| 193 | securityContexts: SecurityContext[], |
| 194 | ): void { |
| 195 | let expression: o.Expression | ir.Interpolation; |
| 196 | const ast = property.expression.ast; |
| 197 | if (ast instanceof e.Interpolation) { |
| 198 | expression = new ir.Interpolation( |
| 199 | ast.strings, |
| 200 | ast.expressions.map((expr) => convertAst(expr, job, property.sourceSpan)), |
| 201 | [], |
| 202 | ); |
| 203 | } else { |
| 204 | expression = convertAst(ast, job, property.sourceSpan); |
| 205 | } |
| 206 | job.root.update.push( |
| 207 | ir.createBindingOp( |
| 208 | job.root.xref, |
| 209 | bindingKind, |
| 210 | property.name, |
| 211 | expression, |
| 212 | null, |
| 213 | securityContexts, |
| 214 | false, |
| 215 | false, |
| 216 | null, |
| 217 | /* TODO: How do Host bindings handle i18n attrs? */ null, |
| 218 | property.sourceSpan, |
| 219 | ), |
| 220 | ); |
| 221 | } |
| 222 | |
| 223 | export function ingestHostAttribute( |
| 224 | job: HostBindingCompilationJob, |
no test coverage detected