michael@0: function bar(x, y) { michael@0: return x + y; michael@0: } michael@0: michael@0: function foo(x, y) { michael@0: var a = 0; michael@0: for (var i = 0; i < 1000; i++) { michael@0: a += bar(x, y); michael@0: a += bar(x, y); michael@0: a += bar(x, y); michael@0: a += bar(x, y); michael@0: } michael@0: return a; michael@0: } michael@0: michael@0: var q = foo(0, 1); michael@0: assertEq(q, 4000);