blob: 1fdfef5c47bc8f60a5ad06e8d802471dd1a62548 [file] [log] [blame]
(function() {
function foo(x) { return 1; }
function bar(x) { return x; }
var f = foo;
var g = bar;
var result = 0;
var n = 100000;
for (var i = 0; i < n; ++i) {
result += f(42);
var tmp = f;
f = g;
g = tmp;
}
if (result != n / 2 * 42 + n / 2 * 1)
throw "Error: bad result: " + result;
})();