static void callSuperclass(final Tree.ExtendedType extendedType, final Class d, final Node that,
final List<Declaration> superDecs, final GenerateJsVisitor gen) {
if (extendedType!=null) {
Tree.PositionalArgumentList argList = extendedType.getInvocationExpression()
.getPositionalArgumentList();
TypeDeclaration typeDecl = extendedType.getType().getDeclarationModel();
gen.out(gen.memberAccessBase(extendedType.getType(), typeDecl, false,
gen.qualifiedPath(that, typeDecl, false)),
(gen.opts.isOptimize() && (gen.getSuperMemberScope(extendedType.getType()) != null))
? ".call(this," : "(");
gen.getInvoker().generatePositionalArguments(extendedType.getInvocationExpression().getPrimary(),
argList, argList.getPositionalArguments(), false, false);
if (argList.getPositionalArguments().size() > 0) {
gen.out(",");
}
//There may be defaulted args we must pass as undefined
final List<com.redhat.ceylon.compiler.typechecker.model.Parameter> superParams =
d.getExtendedTypeDeclaration().getParameterList().getParameters();
if (superParams.size() > argList.getPositionalArguments().size()) {
for (int i = argList.getPositionalArguments().size(); i < superParams.size(); i++) {
com.redhat.ceylon.compiler.typechecker.model.Parameter p = superParams.get(i);
if (p.isSequenced()) {
gen.out(gen.getClAlias(), "getEmpty(),");
} else {
gen.out("undefined,");
}
}
}
//If the supertype has type arguments, add them to the call
if (typeDecl.getTypeParameters() != null && !typeDecl.getTypeParameters().isEmpty()) {
extendedType.getType().getTypeArgumentList().getTypeModels();
TypeUtils.printTypeArguments(that, TypeUtils.matchTypeParametersWithArguments(typeDecl.getTypeParameters(),
extendedType.getType().getTypeArgumentList().getTypeModels()), gen, false, null);
gen.out(",");
}
gen.out(gen.getNames().self(d), ")");
gen.endLine(true);