summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testArrayPushPop.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testArrayPushPop.js')
-rw-r--r--js/src/jit-test/tests/basic/testArrayPushPop.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testArrayPushPop.js b/js/src/jit-test/tests/basic/testArrayPushPop.js
new file mode 100644
index 000000000..8e00dad23
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testArrayPushPop.js
@@ -0,0 +1,11 @@
+function testArrayPushPop() {
+ var a = [], sum1 = 0, sum2 = 0;
+ for (var i = 0; i < 10; ++i)
+ sum1 += a.push(i);
+ for (var i = 0; i < 10; ++i)
+ sum2 += a.pop();
+ a.push(sum1);
+ a.push(sum2);
+ return a.join(",");
+}
+assertEq(testArrayPushPop(), "55,45");