I have a tail recursive pathfinding algorithm that I've implemented in JavaScript and would like to know if any (all?) browsers would possibly get stack overflow exceptions.
The ECMAScript 4 specification was originally going to add support for TCO, but it was dropped:
No more tail calls in JavaScript?
As far as I know, no widely-available implementations of JavaScript currently do automatic TCO. This may be of use to you, though:
Tail Call Optimization
Essentially, using the accumulator pattern accomplish the same effect.
2.1m questions
2.1m answers
60 comments
57.0k users