mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
JS: fix long emulation in JS engines that don't support BigInt
This commit is contained in:
parent
0b36010a19
commit
2c7b5be62e
|
@ -744,6 +744,12 @@ function Long(lo, hi) {
|
|||
Long.prototype.__teavm_class__ = function() {
|
||||
return "long";
|
||||
};
|
||||
function Long_isPositive(a) {
|
||||
return (a.hi & 0x80000000) === 0;
|
||||
}
|
||||
function Long_isNegative(a) {
|
||||
return (a.hi & 0x80000000) !== 0;
|
||||
}
|
||||
|
||||
var Long_MAX_NORMAL = 1 << 18;
|
||||
var Long_ZERO;
|
||||
|
@ -754,14 +760,6 @@ var Long_toNumber;
|
|||
var Long_hi;
|
||||
var Long_lo;
|
||||
if (typeof BigInt !== "function") {
|
||||
function Long_isPositive(a) {
|
||||
return (a.hi & 0x80000000) === 0;
|
||||
}
|
||||
|
||||
function Long_isNegative(a) {
|
||||
return (a.hi & 0x80000000) !== 0;
|
||||
}
|
||||
|
||||
Long.prototype.toString = function() {
|
||||
var result = [];
|
||||
var n = this;
|
||||
|
|
Loading…
Reference in New Issue
Block a user