JS: add test to prove that anonymous function that declares lambda is translated correctly. See KT-11589
This commit is contained in:
@@ -2233,6 +2233,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/expression/function"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousWithLambda.kt")
|
||||
public void testAnonymousWithLambda() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/expression/function/anonymousWithLambda.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("callFunInInit.kt")
|
||||
public void testCallFunInInit() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/expression/function/callFunInInit.kt");
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
val a = (fun(): String {
|
||||
val o = { "O" }
|
||||
return o() + "K"
|
||||
})
|
||||
return a()
|
||||
}
|
||||
Reference in New Issue
Block a user