From 9c0e049bbe716581e186f9998c719b9bfbb8a0d0 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 30 Nov 2017 19:38:35 +0300 Subject: [PATCH] JS: fix boxed char with latest changes in compiler --- js/js.libraries/src/core/builtins.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/js.libraries/src/core/builtins.kt b/js/js.libraries/src/core/builtins.kt index 6094ef38d4b..d7316b2c24b 100644 --- a/js/js.libraries/src/core/builtins.kt +++ b/js/js.libraries/src/core/builtins.kt @@ -132,26 +132,26 @@ internal fun newThrowable(message: String?, cause: Throwable?): Throwable { } @JsName("BoxedChar") -internal class BoxedChar(val c: Char) : Comparable { +internal class BoxedChar(val c: Int) : Comparable { override fun equals(other: Any?): Boolean { return other is BoxedChar && c == other.c } override fun hashCode(): Int { - return c.toInt() + return c } override fun toString(): String { - return c.toString() + return js("this.c").unsafeCast().toString() } - override fun compareTo(other: Char): Int { - return c - other + override fun compareTo(other: Int): Int { + return js("this.c - other").unsafeCast() } @JsName("valueOf") public fun valueOf(): Int { - return js("this.c") + return c } }