Generate JS source map for if statement got from optional argument

This commit is contained in:
Alexey Andreev
2017-06-23 10:58:00 +03:00
parent 1e74325c52
commit fa95f78e78
4 changed files with 4 additions and 3 deletions
@@ -91,6 +91,7 @@ public final class FunctionBodyTranslator extends AbstractTranslator {
JsBinaryOperation checkArgIsUndefined = equality(jsNameRef, Namer.getUndefinedExpression());
checkArgIsUndefined.source(KotlinSourceElementKt.getPsi(valueParameter.getSource()));
JsIf jsIf = JsAstUtils.newJsIf(checkArgIsUndefined, thenStatement);
jsIf.setSource(checkArgIsUndefined.getSource());
result.add(jsIf);
}
@@ -11,4 +11,4 @@ fun baz() = 1
fun bar() = 2
// LINES: 8 * 2 3 4 4 5 2 8 10 10 12 12
// LINES: 8 * 2 2 3 4 4 5 2 8 10 10 12 12
@@ -10,4 +10,4 @@ class B : A() {
}
}
// LINES: 1 2 2 2 2 2 2 4 4 * 7 7 10 9
// LINES: 1 2 2 2 2 2 2 2 4 4 * 7 7 10 9
+1 -1
View File
@@ -7,4 +7,4 @@ fun box(
println(y)
}
// LINES: 8 2 2 3 3 4 6 7
// LINES: 8 2 2 2 3 3 3 4 6 7