In input, both functions return 123. In output, first function returns itself, because it's been named explicitly in the output, which introduces another binding for f.
Livepack avoids this problem where the eval() is inside the function which is named, but not where the eval() which freezes the external var name is in another function.
Input:
Output (with
mangle
option enabled):In input, both functions return
123
. In output, first function returns itself, because it's been named explicitly in the output, which introduces another binding forf
.Livepack avoids this problem where the
eval()
is inside the function which is named, but not where theeval()
which freezes the external var name is in another function.Correct output would be: