Sanitize names for backing fields and private declarations in JS BE

See KT-1816
This commit is contained in:
Alexey Andreev
2017-09-07 11:52:08 +03:00
parent 206369c088
commit 502c51ccff
4 changed files with 58 additions and 1 deletions
@@ -322,7 +322,10 @@ class NameSuggestion {
@JvmStatic fun getPrivateMangledName(baseName: String, descriptor: CallableDescriptor): String {
val ownerName = descriptor.containingDeclaration.fqNameUnsafe.asString()
return getStableMangledName(baseName, ownerName + ":" + encodeSignature(descriptor))
// Base name presents here since name part gets sanitized, so we have to produce different suffixes to distinguish
// between, say `.` and `;`.
return getStableMangledName(sanitizeName(baseName), ownerName + "." + baseName + ":" + encodeSignature(descriptor))
}
fun getInternalMangledName(suggestedName: String, forCalculateId: String): String {