Restore original variable name mangling for captured/receiver $this
Design for the new one is still not finished.
This commit is contained in:
@@ -37,22 +37,14 @@ fun mangleNameIfNeeded(name: String): String {
|
||||
if (c.isValidCharacter()) {
|
||||
append(c)
|
||||
} else {
|
||||
append('-').append(c.toHex())
|
||||
val hexString = Integer.toHexString(c.toInt())
|
||||
assert(hexString.length <= 4)
|
||||
append("_u").append(hexString)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Char.toHex(): String {
|
||||
val hexString = Integer.toHexString(this.toInt())
|
||||
assert(hexString.length <= 4)
|
||||
return if (hexString.length == 4) {
|
||||
hexString
|
||||
} else {
|
||||
"0".repeat(4 - hexString.length) + hexString
|
||||
}
|
||||
}
|
||||
|
||||
private fun Char.isValidCharacter(): Boolean {
|
||||
return this != '$' && this != '-' && isValidDalvikCharacter(this)
|
||||
}
|
||||
Reference in New Issue
Block a user