[JS BE] Do not produce source mapping for fake KtElement
Fix [KT-26701], [KT-12935]
This commit is contained in:
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.js.backend.ast.JsLocationWithSource;
|
||||
import org.jetbrains.kotlin.js.sourceMap.SourceFilePathResolver;
|
||||
import org.jetbrains.kotlin.js.sourceMap.SourceMapMappingConsumer;
|
||||
import org.jetbrains.kotlin.js.translate.utils.PsiUtils;
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -87,6 +88,7 @@ public class SourceMapBuilderConsumer implements SourceLocationConsumer {
|
||||
}
|
||||
if (sourceInfo instanceof PsiElement) {
|
||||
PsiElement element = (PsiElement) sourceInfo;
|
||||
if (CallUtilKt.isFakePsiElement(element)) return;
|
||||
try {
|
||||
JsLocation location = PsiUtils.extractLocationFromPsi(element, pathResolver);
|
||||
PsiFile psiFile = element.getContainingFile();
|
||||
|
||||
+1
-1
@@ -14,4 +14,4 @@ suspend fun bar(): Unit {
|
||||
println(a + b)
|
||||
}
|
||||
|
||||
// LINES: 38 4 4 4 5 5 44 44 5 89 44 5 5 6 4 4 4 15 9 9 9 * 15 10 10 11 11 11 2 11 11 * 11 12 12 13 13 13 2 13 13 13 13 14 14 * 15 9 9 9 9
|
||||
// LINES: 38 4 4 4 5 5 44 44 5 89 44 5 5 6 4 4 4 15 9 9 9 * 15 10 10 11 11 11 11 11 * 11 12 12 13 13 13 13 13 13 13 14 14 * 15 9 9 9 9
|
||||
@@ -8,4 +8,4 @@ suspend fun foo() {
|
||||
suspend fun delay() {
|
||||
}
|
||||
|
||||
// LINES: 6 1 1 * 6 2 2 2 2 2 * 3 3 4 4 4 2 4 4 5 5 * 6 1 1 1 1 9
|
||||
// LINES: 6 1 1 * 6 2 2 2 2 2 * 3 3 4 4 4 4 4 5 5 * 6 1 1 1 1 9
|
||||
@@ -15,4 +15,4 @@ class B {
|
||||
}
|
||||
}
|
||||
|
||||
// LINES: 3 4 5 * 4 4 4 2 * 8 11 10 10 15 14 14
|
||||
// LINES: 3 4 5 * 4 4 4 * 8 11 10 10 15 14 14
|
||||
Reference in New Issue
Block a user