mirror of https://github.com/tc39/test262.git
21 lines
365 B
JavaScript
21 lines
365 B
JavaScript
//@ runBigIntEnabled
|
|
|
|
function assert(a, e) {
|
|
if (a !== e) {
|
|
throw new Error("Bad!");
|
|
}
|
|
}
|
|
|
|
function logicalAnd(a, b) {
|
|
return a && b;
|
|
}
|
|
noInline(logicalAnd);
|
|
|
|
for (let i = 0; i < 100000; i++) {
|
|
assert(logicalAnd(1n, 10n), 10n);
|
|
assert(logicalAnd(1n, 1n), 1n);
|
|
assert(logicalAnd(1n, 0n), 0n);
|
|
assert(logicalAnd(1n, -1n), -1n);
|
|
}
|
|
|