summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1655940-3.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/ion/bug1655940-3.js')
-rw-r--r--js/src/jit-test/tests/ion/bug1655940-3.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/bug1655940-3.js b/js/src/jit-test/tests/ion/bug1655940-3.js
new file mode 100644
index 0000000000..a9d984dd68
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug1655940-3.js
@@ -0,0 +1,21 @@
+var ToObject = getSelfHostedValue("ToObject");
+
+function f(arr) {
+ for (var i = 0; i < arr.length; i++) {
+ var v = arr[i];
+ try {
+ var x = 1;
+ ToObject({});
+ x = 2;
+ ToObject(v);
+ } catch (e) {
+ assertEq(x, 2);
+ }
+ }
+}
+
+var a = [];
+for (var i = 0; i < 50; i++) {
+ a.push({}, null);
+}
+f(a);