JS backend: fix KT-5738 JS backend: result of toByte() should be in the range of bytes

#KT-5738 Fixed
This commit is contained in:
Michael Nedzelsky
2014-09-06 15:40:49 +04:00
parent a632e9e21d
commit cc4f84ffae
7 changed files with 168 additions and 34 deletions
+8
View File
@@ -89,6 +89,14 @@
return a < b ? -1 : a > b ? 1 : 0;
};
Kotlin.toShort = function(a) {
return (a & 0xFFFF) << 16 >> 16;
};
Kotlin.toByte = function(a) {
return (a & 0xFF) << 24 >> 24;
};
Kotlin.intUpto = function (from, to) {
return new Kotlin.NumberRange(from, to);
};