Support members with dots in their name

This commit is contained in:
Alex Dima
2020-02-22 15:40:20 +01:00
parent 4f21fd58a8
commit c95e2e4bf2
2 changed files with 6 additions and 4 deletions

View File

@@ -135,11 +135,12 @@ function getMassagedTopLevelDeclarationText(sourceFile, declaration, importName,
}
else {
const memberName = member.name.text;
const memberAccess = (memberName.indexOf('.') >= 0 ? `['${memberName}']` : `.${memberName}`);
if (isStatic(member)) {
usage.push(`a = ${staticTypeName}.${memberName};`);
usage.push(`a = ${staticTypeName}${memberAccess};`);
}
else {
usage.push(`a = (<${instanceTypeName}>b).${memberName};`);
usage.push(`a = (<${instanceTypeName}>b)${memberAccess};`);
}
}
}