convertHostAttributeToBinding function

Binding convertHostAttributeToBinding(
  1. String name,
  2. ASTWithSource value,
  3. CompileDirectiveMetadata compileDirectiveMetadata
)

Converts a host attribute to an ir.Binding instance.

Currently host attributes are represented as a map from name to value.

Implementation

// TODO(b/130184376): Create a better HostAttribute representation.
ir.Binding convertHostAttributeToBinding(
        String name,
        expression_ast.ASTWithSource value,
        CompileDirectiveMetadata compileDirectiveMetadata) =>
    ir.Binding(
        source: ir.BoundExpression(value, null, compileDirectiveMetadata),
        target: _attributeName(name));