summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testSwitchUndefined.js
blob: 44d27ca38c5d7a4f01789a657a06d3b4b6d55ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function testSwitchUndefined()
{
  var x = undefined;
  var y = 0;
  for (var i = 0; i < 5; i++)
  {
    switch (x)
    {
      default:
        y++;
    }
  }
  return y;
}
assertEq(testSwitchUndefined(), 5);