summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug925067-1.js
blob: 13e14b643b1fda39bd7523896b4ec1bcdaad2afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);