Exception : Out of memory for negative Int64 number

Hi Team,

We are using Remoting SDK (JavaScript) framework to access our server.

When we are passing negative Int64(-1) number we are getting Out of memory error.
We looked into the code of RemObjectSDK.js then we found below function have error.

BinaryParser.prototype.encodeInt = function encodeInt(number, bits, signed) {
var max = Math.pow(2, bits),
r = [];
(number >= max || number < -Math.pow(2, bits - 1)) && this.warn(‘encodeInt::overflow’) && (number = 0);
number < 0 && (number += max);
for (; number; r[r.length] = String.fromCharCode(number % 256), number = Math.floor(number / 256));
for (bits = -(-bits >> 3) - r.length; bits–; r[r.length] = ‘\0’);
return (this.bigEndian ? r.reverse() : r).join(’’);
};

Tested on below versions, have same error.
[Remoting SDK - 10.0.0.1495]
[Remoting SDK - 10.0.0.1505]

Thanks!

Thanks, logged as bugs://85798

Please note that it is better not to use Int64 at all in JavaScript. Due to platform limitations there are only 48 bits available, not 64.

Please dop a mail to support@ so we’ll send you the fixed RemObjectsSDK.js once the issue is fixed

bugs://85798 got closed with status fixed.