[JS IR] Add tests with export all file and export nested class

[JS IR] Skip dce driven for nested classes export

^KT-44469 fixed
This commit is contained in:
Ilya Goncharov
2021-01-21 13:03:56 +03:00
parent 1b68f35f7c
commit 977781fa49
5 changed files with 77 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
// IGNORE_BACKEND: JS
// RUN_PLAIN_BOX_FUNCTION
// INFER_MAIN_MODULE
// MODULE: export-all-file
// FILE: lib.kt
@file:JsExport
abstract class A {
abstract fun foo(k: String): String
}
class B : A() {
override fun foo(k: String): String {
return "O" + k
}
}
// FILE: test.js
function box() {
return new this["export-all-file"].B().foo("K");
}
@@ -0,0 +1,25 @@
// IGNORE_BACKEND: JS
// RUN_PLAIN_BOX_FUNCTION
// INFER_MAIN_MODULE
// SKIP_DCE_DRIVEN
// MODULE: export-nested-class
// FILE: lib.kt
abstract class A {
abstract fun foo(k: String): String
}
@JsExport
class B {
class Foo : A() {
override fun foo(k: String): String {
return "O" + k
}
}
}
// FILE: test.js
function box() {
return new this["export-nested-class"].B.Foo().foo("K");
}