1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
actual = ''; expected = '99,'; function g(p) { appendToActual(p()); } function d(k) { return function() { return k; } } function f(k) { var p; for (var i = 0; i < 1000; ++i) { p = d(k); } g(p); } f(99); assertEq(actual, expected)