Enum implementing exported interface

[JS IR] Not export get instance enum function

[JS IR] Enum corresponding class is not considered in export

[JS IR] All enums are abstract and with private constructor

[JS IR] Any methods is left in d.ts

[JS IR] Make enum with declarations inside corresponding class

[JS IR] Export of interface through fake override

[JS IR] Include enum entry corresponding class members into export model

Merge-request: KT-MR-5031

^KT-49779 fixed
^KT-49773 fixed
This commit is contained in:
Ilya Goncharov
2021-11-24 12:25:50 +00:00
committed by Space
parent 4181429c7e
commit 1481ad21f5
17 changed files with 440 additions and 41 deletions
+11 -9
View File
@@ -29,6 +29,7 @@ enum class Bar {
init {
d = "d2"
}
fun huh() = "huh"
};
val foo = ordinal
@@ -66,19 +67,20 @@ function box() {
if (this["export_enum_class"].Bar.A.bay() !== "A") return "fail15"
if (this["export_enum_class"].Bar.B.bay() !== "B") return "fail16"
if (this["export_enum_class"].Bar.B.constructor.prototype.hasOwnProperty('baz')) return "fail17"
if (this["export_enum_class"].Bar.B.constructor.prototype.hasOwnProperty('d')) return "fail17"
if (this["export_enum_class"].Bar.B.constructor.prototype.hasOwnProperty('huh')) return "fail18"
if (this["export_enum_class"].Foo.valueOf("A") !== this["export_enum_class"].Foo.A) return "fail18"
if (this["export_enum_class"].Foo.valueOf("B") !== this["export_enum_class"].Foo.B) return "fail19"
if (this["export_enum_class"].Foo.valueOf("A") !== this["export_enum_class"].Foo.A) return "fail19"
if (this["export_enum_class"].Foo.valueOf("B") !== this["export_enum_class"].Foo.B) return "fail20"
if (this["export_enum_class"].Foo.values().indexOf(this["export_enum_class"].Foo.A) === -1) return "fail20"
if (this["export_enum_class"].Foo.values().indexOf(this["export_enum_class"].Foo.B) === -1) return "fail21"
if (this["export_enum_class"].Foo.values().indexOf(this["export_enum_class"].Foo.A) === -1) return "fail21"
if (this["export_enum_class"].Foo.values().indexOf(this["export_enum_class"].Foo.B) === -1) return "fail22"
if (this["export_enum_class"].Foo.A.name !== "A") return "fail22"
if (this["export_enum_class"].Foo.B.name !== "B") return "fail23"
if (this["export_enum_class"].Foo.A.name !== "A") return "fail23"
if (this["export_enum_class"].Foo.B.name !== "B") return "fail24"
if (this["export_enum_class"].Foo.A.ordinal !== 0) return "fail24"
if (this["export_enum_class"].Foo.B.ordinal !== 1) return "fail23"
if (this["export_enum_class"].Foo.A.ordinal !== 0) return "fail25"
if (this["export_enum_class"].Foo.B.ordinal !== 1) return "fail26"
return "OK"
}