Debian Codegraph @

js/src/jit-test/tests/fuses/htmldda-1.js

raw
1 function f(x, y, z, a, b, c) {
2 let sum = 0;
3 sum += x == undefined ? 1 : 0;
4 sum += y == undefined ? 1 : 0;
5 sum += z == undefined ? 1 : 0;
6 sum += a == undefined ? 1 : 0;
7 sum += b == undefined ? 1 : 0;
8 sum += c == undefined ? 1 : 0;
9 return sum;
10 }
11
12 let iters = 500;
13 function test(x) {
14 let count = 0;
15 let [y, z, a, b, c] = [{}, {}, {}, {}, {}];
16 for (let i = 0; i < iters; i++) {
17 count += f(x, y, z, a, b, c) ? 1 : 0;
18 }
19 return count;
20 }
21
22 let count = test({});
23 assertEq(count, 0);
24
25 // pop fuse, and run test again.
26 x = createIsHTMLDDA();
27 count = test(x);
28
29 assertEq(count, iters);