michael@0: function f() { michael@0: switch(2) { michael@0: case 1: return 1; michael@0: case 2: return 2; michael@0: default: return -1; michael@0: } michael@0: } michael@0: assertEq(f(), 2); michael@0: michael@0: function g() { michael@0: switch(3.14) { michael@0: case 3: return 3; michael@0: case 4: return 4; michael@0: default: return -1; michael@0: } michael@0: } michael@0: assertEq(g(), -1); michael@0: