convertElement function

Element convertElement(
  1. ElementAst elementAst,
  2. CompileElement compileElement,
  3. CompileDirectiveMetadata? compileDirectiveMetadata
)

Implementation

ir.Element convertElement(
  ast.ElementAst elementAst,
  CompileElement compileElement,
  CompileDirectiveMetadata? compileDirectiveMetadata,
) {
  var inputs = convertAllToBinding(
    elementAst.inputs,
    compileDirectiveMetadata: compileDirectiveMetadata,
    compileElement: compileElement,
  );

  var outputs = convertAllToBinding(
    elementAst.outputs,
    compileDirectiveMetadata: compileDirectiveMetadata,
    compileElement: compileElement,
  );

  outputs = mergeEvents(outputs);

  var directives = convertMatchedDirectives(
    elementAst.directives,
    compileElement,
    compileDirectiveMetadata!,
  );
  directives = directives.map(optimizeLifecycles).toList();

  return ir.Element(
      compileElement, inputs, outputs, directives, elementAst.children, []);
}