summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug925067-1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/ion/bug925067-1.js')
-rw-r--r--js/src/jit-test/tests/ion/bug925067-1.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/bug925067-1.js b/js/src/jit-test/tests/ion/bug925067-1.js
new file mode 100644
index 000000000..13e14b643
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug925067-1.js
@@ -0,0 +1,25 @@
+var c = 0;
+function g(o) {
+ try {
+ for(;;)
+ o.next();
+ } catch(e) {
+ c += e;
+ }
+ return o.x;
+}
+function f() {
+ var o = {x: 0, next: function() {
+ if (this.x++ > 100)
+ throw 3;
+ }};
+
+ g(o);
+ assertEq(o.x, 102);
+
+ o.x = 0;
+ g(o);
+ assertEq(o.x, 102);
+}
+f();
+assertEq(c, 6);