[JS IR] Generate main method call only for main module
This commit is contained in:
Generated
+5
@@ -880,6 +880,11 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/objectIsObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("onlyMainModuleCall.kt")
|
||||
public void testOnlyMainModuleCall() throws Exception {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/onlyMainModuleCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelExtension.kt")
|
||||
public void testTopLevelExtension() throws Exception {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/topLevelExtension.kt");
|
||||
|
||||
+5
@@ -880,6 +880,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/objectIsObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("onlyMainModuleCall.kt")
|
||||
public void testOnlyMainModuleCall() throws Exception {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/onlyMainModuleCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelExtension.kt")
|
||||
public void testTopLevelExtension() throws Exception {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/topLevelExtension.kt");
|
||||
|
||||
+5
@@ -880,6 +880,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/objectIsObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("onlyMainModuleCall.kt")
|
||||
public void testOnlyMainModuleCall() throws Exception {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/onlyMainModuleCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevelExtension.kt")
|
||||
public void testTopLevelExtension() throws Exception {
|
||||
runTest("js/js.translator/testData/box/crossModuleRefIR/topLevelExtension.kt");
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// SPLIT_PER_MODULE
|
||||
// CALL_MAIN
|
||||
// MODULE: lib
|
||||
// FILE: lib.kt
|
||||
|
||||
package lib
|
||||
|
||||
var log: String = ""
|
||||
|
||||
val hack = ::main
|
||||
|
||||
fun main() {
|
||||
log += "fail"
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
package main
|
||||
|
||||
import lib.*
|
||||
|
||||
fun main() {
|
||||
log += "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return log
|
||||
}
|
||||
Reference in New Issue
Block a user