computeJsName function

String computeJsName (
  1. ClassElement clazz,
  2. ClassElement jsNameClass
)

Implementation

String computeJsName(ClassElement clazz, ClassElement jsNameClass) {
  var name = '';

  final nameOfLib =
      getNameAnnotation(clazz.library.unit.directives.first, jsNameClass);
  if (nameOfLib != null) name += '$nameOfLib.';

  final nameOfClass = getNameAnnotation(getNodeOfElement(clazz), jsNameClass);
  if (nameOfClass != null) {
    name += nameOfClass;
  } else {
    name += getPublicClassName(clazz);
  }
  return name;
}