KotlinStringLiteralTextEscaper: provides offsets for already decoded (KT-27380)

This commit is contained in:
Nicolay Mitropolsky
2018-11-12 17:47:18 +03:00
parent 6342bc378e
commit 4a64edd610
2 changed files with 27 additions and 0 deletions
@@ -41,6 +41,9 @@ class KotlinStringLiteralTextEscaper(host: KtStringTemplateExpression) : Literal
is KtEscapeStringTemplateEntry -> {
if (!rangeInsideHost.contains(childRange)) {
//don't allow injection if its range starts or ends inside escaped sequence
//but still process offsets for the already decoded part
sourceOffsetsList.add(sourceOffset)
sourceOffsets = sourceOffsetsList.toNativeArray()
return false
}
val unescaped = child.unescapedValue