blob: 920de31a9b4e95d133608201f91a003327bcc1cf [file] [log] [blame]
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntOperations(a, b) {
let c = a - b;
return a - c;
}
noInline(bigIntOperations);
c = 0;
let o = { valueOf: function () {
c++;
return 0b1111n;
}};
for (let i = 0; i < 100000; i++) {
let out = bigIntOperations(o, 0b1010n);
assert(out, 10n);
}
assert(c, 200000);