summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testConcatNWithSideEffects.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testConcatNWithSideEffects.js')
-rw-r--r--js/src/jit-test/tests/basic/testConcatNWithSideEffects.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testConcatNWithSideEffects.js b/js/src/jit-test/tests/basic/testConcatNWithSideEffects.js
new file mode 100644
index 000000000..b7b636e5d
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testConcatNWithSideEffects.js
@@ -0,0 +1,12 @@
+var log;
+function b(x) { log += 'b'; return 'B'; }
+function g() {
+ log = '';
+ var a = {toString: function () { log += 'a'; return 'A'; }};
+ assertEq("[" + a + b() + "]", "[AB]");
+ assertEq(log, "ab");
+}
+
+for (var i = 0; i < 1000; ++i)
+ g();
+