Fix JS source maps for optional arguments

Also, when function has expression body, use expression instead
of function declaration to mark return statement.
This commit is contained in:
Alexey Andreev
2017-05-15 17:45:32 +03:00
parent 6f0e4c4deb
commit b70c52e41f
7 changed files with 28 additions and 6 deletions
+1 -1
View File
@@ -5,4 +5,4 @@ fun box(x: Int, y: Int): Int {
return foo(y)
}
// LINES: 2 2 4 2 5
// LINES: 2 4 2 5
@@ -0,0 +1,14 @@
fun foo(
a: Int =
when (baz()) {
1 -> bar();
else -> 0
}
): Int =
a + 1
fun baz() = 1
fun bar() = 2
// LINES: 2 3 4 4 5 2 8 10 12
+1 -1
View File
@@ -14,4 +14,4 @@ suspend fun bar(): Unit {
println(a + b)
}
// LINES: 4 5 4 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
// LINES: 4 5 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
@@ -4,4 +4,4 @@ fun box() =
fun foo() =
23
// LINES: 1 2 4 5
// LINES: 2 5
+1 -1
View File
@@ -7,4 +7,4 @@ fun box(
println(y)
}
// LINES: 2 2 3 4 6 7
// LINES: 2 2 3 3 4 6 7