blob: 7c821043a6195e8aa7ff04cb38da737b1d18014e [file] [log] [blame]
function direct() {
return arguments;
}
function scoped(a) {
if (!effectful42())
return function() { return a; }
return arguments;
}
function foo(a) {
try {
return a[0];
} catch (e) {
return -23;
}
}
for (var i = 0; i < 100; ++i) {
var result = foo(scoped(42));
if (result != 42)
throw "Error: bad result: " + result;
}
for (var i = 0; i < 100; ++i) {
var result = foo(direct(42));
if (result != 42)
throw "Error: bad result: " + result;
}