[JS IR] Run diagnostics by IR before the klib serialization

Implement an infrastructure for checking IR before JS klib serialization.
Implement the EXPORTING_JS_NAME_CLASH and EXPORTING_JS_NAME_CLASH_ES checks.

^KT-61710 Fixed
This commit is contained in:
Alexander Korepanov
2023-09-07 22:08:22 +02:00
parent 13bd627bfa
commit 522952db1f
24 changed files with 385 additions and 87 deletions
@@ -364,10 +364,7 @@ class Kotlin2JsIrGradlePluginIT : KGPBaseTest() {
fun testProjectWithExportedNamesClash(gradleVersion: GradleVersion) {
project("kotlin-js-invalid-project-with-exported-clash", gradleVersion) {
build("compileKotlinJs") {
assertOutputContains("""
|There are clashes of declaration names that annotated with @JsExport in module 'kotlin-js-invalid-project-with-exported-clash'.
| * Next files contain declarations with @JsExport and name 'best'
""".trimMargin())
assertOutputContains("Exporting name 'best' in ES modules may clash")
}
}
}