JS: fix boxed char with latest changes in compiler

This commit is contained in:
Alexey Andreev
2017-11-30 19:38:35 +03:00
parent 2c79481f37
commit 9c0e049bbe
+6 -6
View File
@@ -132,26 +132,26 @@ internal fun newThrowable(message: String?, cause: Throwable?): Throwable {
} }
@JsName("BoxedChar") @JsName("BoxedChar")
internal class BoxedChar(val c: Char) : Comparable<Char> { internal class BoxedChar(val c: Int) : Comparable<Int> {
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
return other is BoxedChar && c == other.c return other is BoxedChar && c == other.c
} }
override fun hashCode(): Int { override fun hashCode(): Int {
return c.toInt() return c
} }
override fun toString(): String { override fun toString(): String {
return c.toString() return js("this.c").unsafeCast<Char>().toString()
} }
override fun compareTo(other: Char): Int { override fun compareTo(other: Int): Int {
return c - other return js("this.c - other").unsafeCast<Int>()
} }
@JsName("valueOf") @JsName("valueOf")
public fun valueOf(): Int { public fun valueOf(): Int {
return js("this.c") return c
} }
} }