summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/loops/hoist-06.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/jaeger/loops/hoist-06.js')
-rw-r--r--js/src/jit-test/tests/jaeger/loops/hoist-06.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/jaeger/loops/hoist-06.js b/js/src/jit-test/tests/jaeger/loops/hoist-06.js
new file mode 100644
index 0000000000..fc2919cda2
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/loops/hoist-06.js
@@ -0,0 +1,14 @@
+
+function foo(x, n, y) {
+ var q = 0;
+ for (var j = 0; j < n; j++) {
+ if (x[j] < y)
+ q++;
+ }
+ assertEq(q, 1);
+}
+
+var x = [1,2,3,4,5];
+var y = { valueOf: function() { x.length = 0; return 6; } };
+
+var a = foo(x, 5, y);