Fix JS source maps for lambdas

This commit is contained in:
Alexey Andreev
2017-05-12 13:57:16 +03:00
parent 82d37c0d57
commit d7a10750e0
4 changed files with 9 additions and 8 deletions
@@ -102,12 +102,6 @@ public class JsLineNumberTestGenerated extends AbstractJsLineNumberTest {
doTest(fileName);
}
@TestMetadata("longLiteral.kt")
public void testLongLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/lineNumbers/longLiteral.kt");
doTest(fileName);
}
@TestMetadata("memberFunWithDefaultParam.kt")
public void testMemberFunWithDefaultParam() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/lineNumbers/memberFunWithDefaultParam.kt");
@@ -461,7 +461,7 @@ public final class ExpressionVisitor extends TranslatorVisitor<JsNode> {
@Override
@NotNull
public JsNode visitLambdaExpression(@NotNull KtLambdaExpression expression, @NotNull TranslationContext context) {
return new LiteralFunctionTranslator(context).translate(expression.getFunctionLiteral());
return new LiteralFunctionTranslator(context).translate(expression.getFunctionLiteral()).source(expression);
}
@Override
+1 -1
View File
@@ -14,4 +14,4 @@ suspend fun bar(): Unit {
println(a + b)
}
// LINES: 4 5 6 * 9 9 9 9 9 9 9 9 * 10 11 11 11 11 11 * 11 12 13 13 13 13 13 13 14
// LINES: 4 5 6 4 9 9 9 9 9 9 9 9 * 10 11 11 11 11 11 * 11 12 13 13 13 13 13 13 14
@@ -0,0 +1,7 @@
fun foo(x: Int): () -> Unit = {
println(x)
}
fun bar() = 23
// LINES: 1 2 1 5