jsI64 function
Dart int → JS BigInt, for int64_t parameters.
v.toJS makes a JS number, so BigInt(v.toJS) would round past 2^53
before the BigInt exists. Large magnitudes go through BigInt("…").
Implementation
JSAny jsI64(int v) {
if (v >= -_maxExactInJsNumber && v <= _maxExactInJsNumber) {
return _jsBigInt.callAsFunction(null, v.toJS)!;
}
return _jsBigInt.callAsFunction(null, v.toString().toJS)!;
}