summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testSwitchUndefined.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testSwitchUndefined.js')
-rw-r--r--js/src/jit-test/tests/basic/testSwitchUndefined.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testSwitchUndefined.js b/js/src/jit-test/tests/basic/testSwitchUndefined.js
new file mode 100644
index 0000000000..44d27ca38c
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testSwitchUndefined.js
@@ -0,0 +1,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);