[JS IR] Fix export of nested enums

Merge-request: KT-MR-5916
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51211 fixed
This commit is contained in:
Ilya Goncharov
2022-03-18 09:45:14 +00:00
committed by Space
parent 644db43e67
commit adad0b4628
6 changed files with 71 additions and 8 deletions
+14
View File
@@ -39,6 +39,14 @@ enum class Bar {
fun bay() = name
}
@JsExport
class OuterClass {
enum class NestedEnum {
A,
B;
}
}
// FILE: test.js
function box() {
if (this["export_enum_class"].Foo.A !== this["export_enum_class"].Foo.A) return "fail1"
@@ -82,5 +90,11 @@ function box() {
if (this["export_enum_class"].Foo.A.ordinal !== 0) return "fail25"
if (this["export_enum_class"].Foo.B.ordinal !== 1) return "fail26"
if (this["export_enum_class"].OuterClass.NestedEnum.A.name !== "A") return "fail27"
if (this["export_enum_class"].OuterClass.NestedEnum.B.name !== "B") return "fail28"
if (this["export_enum_class"].OuterClass.NestedEnum.A.ordinal !== 0) return "fail29"
if (this["export_enum_class"].OuterClass.NestedEnum.B.ordinal !== 1) return "fail30"
return "OK"
}