[K/JS] Make available transitive reexport for ES modules
This commit is contained in:
+12
@@ -2367,6 +2367,12 @@ public class FirJsBoxTestGenerated extends AbstractFirJsBoxTest {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethodInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reexport.kt")
|
||||
public void testReexport() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reexport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
@@ -2920,6 +2926,12 @@ public class FirJsBoxTestGenerated extends AbstractFirJsBoxTest {
|
||||
runTest("js/js.translator/testData/box/export/overridenMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reexport.kt")
|
||||
public void testReexport() throws Exception {
|
||||
runTest("js/js.translator/testData/box/export/reexport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
|
||||
+12
@@ -2367,6 +2367,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethodInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reexport.kt")
|
||||
public void testReexport() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reexport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
@@ -2920,6 +2926,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/export/overridenMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reexport.kt")
|
||||
public void testReexport() throws Exception {
|
||||
runTest("js/js.translator/testData/box/export/reexport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// IGNORE_FIR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS
|
||||
// ES_MODULES
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
|
||||
// MODULE: lib1
|
||||
// FILE: lib1.kt
|
||||
@JsExport
|
||||
fun bar() = "O"
|
||||
|
||||
// MODULE: lib2(lib1)
|
||||
// FILE: lib2.kt
|
||||
|
||||
@JsExport
|
||||
fun baz() = "K"
|
||||
|
||||
// MODULE: main(lib2)
|
||||
// FILE: main.kt
|
||||
|
||||
@JsExport
|
||||
fun result(o: String, k: String) = o + k
|
||||
|
||||
// FILE: entry.mjs
|
||||
// ENTRY_ES_MODULE
|
||||
import { bar, baz, result } from "./reexport_v5.mjs";
|
||||
|
||||
export function box() {
|
||||
const o = bar();
|
||||
const k = baz();
|
||||
return result(o, k);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// IGNORE_FIR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
// RUN_PLAIN_BOX_FUNCTION
|
||||
// INFER_MAIN_MODULE
|
||||
|
||||
// MODULE: lib1
|
||||
// FILE: lib1.kt
|
||||
@JsExport
|
||||
fun bar() = "O"
|
||||
|
||||
// MODULE: lib2(lib1)
|
||||
// FILE: lib2.kt
|
||||
|
||||
@JsExport
|
||||
fun baz() = "K"
|
||||
|
||||
// MODULE: main(lib2)
|
||||
// FILE: main.kt
|
||||
|
||||
@JsExport
|
||||
fun result(o: String, k: String) = o + k
|
||||
|
||||
// FILE: test.js
|
||||
function box() {
|
||||
const { bar, baz, result } = this.main;
|
||||
const o = bar();
|
||||
const k = baz();
|
||||
return result(o, k);
|
||||
}
|
||||
Reference in New Issue
Block a user