michael@0: function heavyFn1(i) { michael@0: if (i == 3) { michael@0: var x = 3; michael@0: return [0, i].map(function (i) i + x); michael@0: } michael@0: return []; michael@0: } michael@0: michael@0: function heavyFn2(i) { michael@0: if (i < 1000) michael@0: return heavyFn1(i); michael@0: return function () i; michael@0: } michael@0: michael@0: function testHeavy2() { michael@0: for (var i = 0; i <= 3; i++) michael@0: heavyFn2(i); michael@0: } michael@0: michael@0: testHeavy2();