use of org.eclipse.ceylon.compiler.js.util.TypeUtils.RuntimeMetamodelAnnotationGenerator in project ceylon by eclipse.
the class GenerateJsVisitor method visit.
@Override
public void visit(final Tree.TypeAliasDeclaration that) {
// Don't even bother with nodes that have errors
if (errVisitor.hasErrors(that))
return;
final TypeAlias d = that.getDeclarationModel();
if (opts.isOptimize() && d.isClassOrInterfaceMember())
return;
comment(that);
final String tname = names.createTempVariable();
out(function, names.name(d), "{var ", tname, "=");
TypeUtils.typeNameOrList(that, that.getTypeSpecifier().getType().getTypeModel(), this, false);
out(";", tname, ".$crtmm$=");
TypeUtils.encodeForRuntime(that, d, this, new RuntimeMetamodelAnnotationGenerator() {
@Override
public void generateAnnotations() {
TypeUtils.outputAnnotationsFunction(that.getAnnotationList(), d, GenerateJsVisitor.this);
}
});
out(";return ", tname, ";}");
endLine();
share(d);
}
Aggregations