brushtail
brushtail copied to clipboard
JS AST rewriter for tail call elimination
We can no longer be sure these are tail calls; they likely aren't. We can use escope again here. Either way, it should take into account variable declarations, function declarations,...
This will make contribution a whole lot easier.
The following code breaks. ``` function factorial_cps(n, k) { if (n === 0) return k(1); return factorial_cps( n - 1, function(result) { return k(n * result); }); } function identity(x)...