What does this number mean? Mr. Aleph pointed out to me that on V8, the number of recursive calls you can make depends on two quantities: the size of the stack and the size of the stack frame (holding parameters and local variables). You can verify the latter by adding local variables to computeMaxCallStackSize() – it’ll return a lower number.

Tail call optimization in ECMAScript 6

ECMAScript 6 will have tail call optimization: If a function call is the last action in a function, it is handled via a “jump”, not via a “subroutine call”. That means that, if you slightly rewrote computeMaxCallStackSize(), it would run forever under ECMAScript 6 (in strict mode):