blob: ebce9fe2c8d8cda985472fea89ff9b84533b0c78 [file] [log] [blame]
var count = 0;
function bar(f) {
if (++count < 10) {
var result = f();
if (result != i + 1)
throw "Error: bad result insie closure for i = " + i + ": " + result;
return;
}
count = 0;
throw "done";
}
noInline(bar);
function foo(a) {
var x = a + 1;
for (;;) {
bar(function() { return x; });
}
}
noInline(foo);
for (var i = 0; i < 10000; ++i) {
try {
foo(i);
} catch (done) {
if (done != "done")
throw "Error: bad exception: " + done;
}
}