js/src/jit-test/tests/ion/bug925067-1.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/ion/bug925067-1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,25 @@
     1.4 +var c = 0;
     1.5 +function g(o) {
     1.6 +    try {
     1.7 +	for(;;)
     1.8 +	    o.next();
     1.9 +    } catch(e) {
    1.10 +	c += e;
    1.11 +    }
    1.12 +    return o.x;
    1.13 +}
    1.14 +function f() {
    1.15 +    var o = {x: 0, next: function() {
    1.16 +	if (this.x++ > 100)
    1.17 +	    throw 3;
    1.18 +    }};
    1.19 +
    1.20 +    g(o);
    1.21 +    assertEq(o.x, 102);
    1.22 +
    1.23 +    o.x = 0;
    1.24 +    g(o);
    1.25 +    assertEq(o.x, 102);
    1.26 +}
    1.27 +f();
    1.28 +assertEq(c, 6);

mercurial