Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / jit-test / tests / basic / testConstSwitch.js
1 // No test case, just make sure this doesn't assert.
2 function testNegZero2() {
3     var z = 0;
4     for (let j = 0; j < 5; ++j) { ({p: (-z)}); }
5 }
6 testNegZero2();
7
8 function testConstSwitch() {
9     var x;
10     for (var j=0;j<5;++j) { switch(1.1) { case NaN: case 2: } x = 2; }
11     return x;
12 }
13 assertEq(testConstSwitch(), 2);