3 ms·
I'm not sure where you got this idea. V8 does not optimize tail calls. It's easy to see this in the Chrome console, I just entered this now: var a = function
by mhansen 15y ago
I'm not sure where you got this idea. V8 does not optimize tail calls. It's easy to see this in the Chrome console, I just entered this now:
var a = function(x) { if (x == 0) return 'done'; return a(x-1); };
a(100000);
RangeError: Maximum call stack size exceeded
http://code.google.com/p/v8/issues/detail?id=457 http://code.google.com/p/v8/issues/detail?id=457
- gcr 15y agoWait, seriously? I didn't know that. Thanks for the link! Guess it's time for me to stop relying on that behavior...