[JS IR] Add a test case with same names for private val
The test case checks, that KT-44728 has been already fixed
This commit is contained in:
committed by
Space
parent
7b60c0427e
commit
f99b80c8d2
@@ -6821,6 +6821,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
|||||||
public void testPackageAndPrivateDeclarationDoNotClash() throws Exception {
|
public void testPackageAndPrivateDeclarationDoNotClash() throws Exception {
|
||||||
runTest("js/js.translator/testData/box/multiFile/packageAndPrivateDeclarationDoNotClash.kt");
|
runTest("js/js.translator/testData/box/multiFile/packageAndPrivateDeclarationDoNotClash.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("samePrivateVals.kt")
|
||||||
|
public void testSamePrivateVals() throws Exception {
|
||||||
|
runTest("js/js.translator/testData/box/multiFile/samePrivateVals.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+6
@@ -7205,6 +7205,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
|||||||
public void testPackageAndPrivateDeclarationDoNotClash() throws Exception {
|
public void testPackageAndPrivateDeclarationDoNotClash() throws Exception {
|
||||||
runTest("js/js.translator/testData/box/multiFile/packageAndPrivateDeclarationDoNotClash.kt");
|
runTest("js/js.translator/testData/box/multiFile/packageAndPrivateDeclarationDoNotClash.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("samePrivateVals.kt")
|
||||||
|
public void testSamePrivateVals() throws Exception {
|
||||||
|
runTest("js/js.translator/testData/box/multiFile/samePrivateVals.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// FILE: file1.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
private val jsObject: dynamic = js("{str: 'File1Str'}")
|
||||||
|
private val fileString: String = jsObject.str
|
||||||
|
fun file1Fun() = fileString
|
||||||
|
|
||||||
|
// FILE: file2.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
private val jsObject: dynamic = js("{str: 'File2Str'}")
|
||||||
|
private val fileString: String = jsObject.str
|
||||||
|
fun file2Fun() = fileString
|
||||||
|
|
||||||
|
// FILE: box.kt
|
||||||
|
package foo
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
assertEquals(file1Fun(), "File1Str")
|
||||||
|
assertEquals(file2Fun(), "File2Str")
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user