Debian Codegraph @

js/src/jit-test/tests/ion/bug1556571.js

raw
1 // Ensure that convertDoubleToInt32 allows the -0 case.
2
3 // If convertDoubleToInt32 fails on the -0 case, then 0 !== -0 below,
4 // so it will fall through to the default case.
5 function test(v) {
6 switch(v) {
7 case 0: return;
8 default: assertEq(true, false); break;
9 }
10 }
11
12 for (var i = 0; i < 10000; i++) {
13 test(i % 2 === 0 ? 0 : -0);
14 }