Closed MichalZalecki closed 7 years ago
Some JavaScript engines and Babel have disabled the tail call optimization because of its complexity.
@MichalZalecki as you can see on compatibility table, still in 2017 almost no major js engine supports TCO. I am not sure why is that... probably full compliance with spec is waaaay harder than what this plugin tries to achieve.
@xtuc is right. Babel used to have TCO (i guess in version 5.x) but it was quite buggy. I found some old issues and tried to create workarounds for them (mostly for function scope). My workaround was simply not to attempt to optimize it at all :D
@xtuc @krzkaczor Thanks guys for a quick response 👏
Krzysztof, can you shed some light why plugins' optimization is a thing? I'm refering to introduced optimizations.