summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js')
-rw-r--r--js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js b/js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js
new file mode 100644
index 000000000..f9899b192
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testScriptGetter_JSOP_CALLPROP-2.js
@@ -0,0 +1,13 @@
+// Test that the tracer is not confused by a.m() when a is the same shape each
+// time through the loop but a.m is a scripted getter that returns different
+// functions.
+
+function f() { return 'f'; }
+function g() { return 'g'; }
+var arr = [f, f, f, f, f, f, f, f, g];
+var a = {get m() { return arr[i]; }};
+
+var s = '';
+for (var i = 0; i < 9; i++)
+ s += a.m();
+assertEq(s, 'ffffffffg');