Fix comparison of boolean values in JS BE

See KT-16984
This commit is contained in:
Alexey Andreev
2017-05-25 16:48:08 +03:00
parent f5510b8d66
commit dde50a34db
8 changed files with 42 additions and 18 deletions
+4 -4
View File
@@ -17,14 +17,14 @@
Kotlin.compareTo = function (a, b) {
var typeA = typeof a;
var typeB = typeof a;
if (Kotlin.isChar(a) && typeB == "number") {
if (Kotlin.isChar(a) && typeB === "number") {
return Kotlin.primitiveCompareTo(a.charCodeAt(0), b);
}
if (typeA == "number" && Kotlin.isChar(b)) {
if (typeA === "number" && Kotlin.isChar(b)) {
return Kotlin.primitiveCompareTo(a, b.charCodeAt(0));
}
if (typeA == "number" || typeA == "string") {
return a < b ? -1 : a > b ? 1 : 0;
if (typeA === "number" || typeA === "string" || typeA === "boolean") {
return Kotlin.primitiveCompareTo(a, b);
}
return a.compareTo_11rb$(b);
};