diff --git a/js/js.translator/testData/box/export/exportEnumClass.kt b/js/js.translator/testData/box/export/exportEnumClass.kt index 4a2c38e512d..8d7ce9778b5 100644 --- a/js/js.translator/testData/box/export/exportEnumClass.kt +++ b/js/js.translator/testData/box/export/exportEnumClass.kt @@ -6,9 +6,9 @@ // FILE: lib.kt @JsExport -enum class Foo { - A, - B; +enum class Foo(val constructorParameter: String) { + A("aConstructorParameter"), + B("bConstructorParameter"); val foo = ordinal @@ -54,16 +54,25 @@ function box() { if (this["export-enum-class"].Foo.A.bay() !== "A") return "fail8" if (this["export-enum-class"].Foo.B.bay() !== "B") return "fail9" - if (this["export-enum-class"].Bar.A.foo !== 0) return "fail10" - if (this["export-enum-class"].Bar.B.foo !== 1) return "fail11" + if (this["export-enum-class"].Foo.A.constructorParameter !== "aConstructorParameter") return "fail10" + if (this["export-enum-class"].Foo.B.constructorParameter !== "bConstructorParameter") return "fail11" - if (this["export-enum-class"].Bar.A.bar("A") !== "A") return "fail12" - if (this["export-enum-class"].Bar.B.bar("B") !== "B") return "fail13" + if (this["export-enum-class"].Bar.A.foo !== 0) return "fail12" + if (this["export-enum-class"].Bar.B.foo !== 1) return "fail13" - if (this["export-enum-class"].Bar.A.bay() !== "A") return "fail14" - if (this["export-enum-class"].Bar.B.bay() !== "B") return "fail15" + if (this["export-enum-class"].Bar.A.bar("A") !== "A") return "fail14" + if (this["export-enum-class"].Bar.B.bar("B") !== "B") return "fail15" - if (this["export-enum-class"].Bar.B.constructor.prototype.hasOwnProperty('baz')) return "fail16" + 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"].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.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" return "OK" } \ No newline at end of file