blob: 13686e1119ed86071ad00cd75ce2152484b0ff1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Test inlining natives through Function.prototype.call
function test(fn, expected) {
for (let i = 0; i < 400; ++i) {
let r = fn.call(null, 0, 1);
assertEq(r, expected);
}
}
for (let i = 0; i < 2; ++i) {
let fn, expected;
if (i === 0) {
fn = Math.min;
expected = 0;
} else {
fn = Math.max;
expected = 1;
}
test(fn, expected);
}
|