UNPKG
tco
Version:
latest (0.0.15)
0.0.15
0.0.14
0.0.13
0.0.12
0.0.11
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Tail call optimization in Node
github.com/rsp/node-tco
rsp/node-tco
tco
/
debug
/
debug-leak1.js
22 lines
(13 loc)
•
402 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var
tf =
function
(
) {
var
nf = tf.
tco
, na =
arguments
, next =
true
;
while
(
1
) {
var
r = nf.
apply
(
null
, na); nf = r[
0
].
tco
; na = r[
1
]; } }; tf.
tco
=
function
(
i
) {
console
.
log
(i);
return
[tf, [i+
1
]]; };
tf
(
1
);