JS backend: fix KT-5772 wrong code generated when <,<=,>,>= are used with explicit Comparable type

#KT-5772 Fixed
This commit is contained in:
Michael Nedzelsky
2014-09-18 22:13:21 +04:00
parent 1d71016097
commit bdca7e0e37
8 changed files with 81 additions and 19 deletions
+12
View File
@@ -86,9 +86,21 @@
};
Kotlin.compareTo = function(a, b) {
var type = typeof a;
if (type == "number" || type == "string") {
return a < b ? -1 : a > b ? 1 : 0;
}
return a.compareTo_za3rmp$(b);
};
Kotlin.primitiveCompareTo = function(a, b) {
return a < b ? -1 : a > b ? 1 : 0;
};
Kotlin.isNumber = function (a) {
return typeof a == "number";
};
Kotlin.toShort = function(a) {
return (a & 0xFFFF) << 16 >> 16;
};