summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/in.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/jaeger/in.js')
-rw-r--r--js/src/jit-test/tests/jaeger/in.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/in.js b/js/src/jit-test/tests/jaeger/in.js
new file mode 100644
index 000000000..a179d60ec
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/in.js
@@ -0,0 +1,21 @@
+function f(arr, b) {
+ var res = "";
+ var a;
+ if (b)
+ a = arr;
+ for (var i=100; i>-200; i--) {
+ if (i in a) {
+ res += i;
+ }
+ }
+ return res;
+}
+
+assertEq(f([1, , 2, 3], true), "320");
+
+try {
+ f([1, , 2, 3], false);
+ assertEq(0, 1);
+} catch(e) {
+ assertEq(e instanceof TypeError, true);
+}