summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/pic/set2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/pic/set2.js')
-rw-r--r--js/src/jit-test/tests/pic/set2.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/pic/set2.js b/js/src/jit-test/tests/pic/set2.js
new file mode 100644
index 0000000000..8713642e48
--- /dev/null
+++ b/js/src/jit-test/tests/pic/set2.js
@@ -0,0 +1,14 @@
+function f(k) {
+ var o1 = { a: 5 };
+ var o2 = { b : 7, a : 9 };
+
+ for (var i = 0; i < k; ++i) {
+ var o = i % 2 ? o2 : o1;
+ o.a = i;
+ }
+
+ return o1.a + ',' + o2.a;
+}
+
+assertEq(f(5), '4,3')
+assertEq(f(6), '4,5')