summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/toid.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/ion/toid.js')
-rw-r--r--js/src/jit-test/tests/ion/toid.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/toid.js b/js/src/jit-test/tests/ion/toid.js
new file mode 100644
index 000000000..33341a5a6
--- /dev/null
+++ b/js/src/jit-test/tests/ion/toid.js
@@ -0,0 +1,10 @@
+function f(arr, index) {
+ for (var i=0; i<100; i++) {
+ arr[index]++;
+ ++arr[index];
+ }
+}
+var arr = [1, 2, 3];
+f(arr, "1");
+f(arr, 1);
+assertEq(arr[1], 402);