JS backend: fix KT-5772 wrong code generated when <,<=,>,>= are used with explicit Comparable type
#KT-5772 Fixed
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user