Are any JavaScript engines tail call (TCO) optimized?

后端 未结 6 1331
有刺的猬
有刺的猬 2020-11-27 03:02

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

6条回答
  •  爱一瞬间的悲伤
    2020-11-27 03:43

    No joy for the moment, but thankfully proper tail calls are slated for Harmony (ECMAScript version 6) http://wiki.ecmascript.org/doku.php?id=harmony:proper_tail_calls

提交回复
热议问题